fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <map>
  5.  
  6. using namespace std;
  7.  
  8. map< int, int > ref_counts;
  9. map< string, vector< int > > chemicals;
  10.  
  11. int main()
  12. {
  13. string input;
  14. // freopen( "file_name", "rb", stdin );
  15. while( getline( std::cin, input ) )
  16. {
  17. vector< int > ids;
  18. for( int pos = 0; pos < input.length(); ++pos )
  19. {
  20. if( input[pos] <= '9' && input[pos] >= '0' )
  21. {
  22. int number = 0;
  23. for( ; input[ pos ] > ' '; ++pos ) // replace to '\t'
  24. number = number * 10 + ( input[ pos ] - '0' );
  25. ids.push_back( number );
  26. ref_counts[ number ]++;
  27. }
  28. else if( input[pos] >= '_' )
  29. {
  30. string kind_name = input.substr( pos, input.length() - pos );
  31. chemicals[ kind_name ] = ids;
  32. break;
  33. }
  34. }
  35. }
  36. for( const auto& c : chemicals )
  37. {
  38. cout << c.first << " : ";
  39. for( const auto& i : c.second )
  40. printf( "%07u ", i );
  41. cout << endl;
  42. }
  43. cout << endl;
  44. for( const auto& r : ref_counts )
  45. printf( "%07u : %5u\n", r.first, r.second );
  46. return 0;
  47. }
Success #stdin #stdout 0s 3424KB
stdin
0003674 molecular_function
0003674 0016209 antioxidant activity
0003674 0016209 0045174 glutathione dehydrogenase (ascorbate) activity
0003674 0016209 0004362 glutathione-disulfide reductase activity
0003674 0016209 0004601 peroxidase activity
0003674 0016209 0004601 0019806 bromide peroxidase activity
0003674 0016209 0004601 0004096 catalase activity
0003674 0016209 0004601 0016691 chloride peroxidase activity
0003674 0016209 0004601 0004130 cytochrome-c peroxidase activity
0003674 0016209 0004601 0016690 diarylpropane peroxidase activity
0003674 0016209 0004601 0047888 fatty-acid peroxidase activity
0003674 0016209 0004601 0004602 glutathione peroxidase activity
0003674 0016209 0004601 0004447 iodide peroxidase activity
0003674 0016209 0004601 0016688 L-ascorbate peroxidase activity
0003674 0016209 0004601 0016689 manganese peroxidase activity
0003674 0016209 0004601 0016692 NADH peroxidase activity
0003674 0016209 0004601 0050137 NADPH peroxidase activity
0003674 0016209 0004601 0047066 phospholipid-hydroperoxide glutathione peroxidase activity
0003674 0016209 0004601 0016693 secretory plant peroxidase activity
0003674 0016209 0004601 0009031 thiol peroxidase activity
0003674 0016209 0004601 0008379 thioredoxin peroxidase activity
0003674 0016209 0004791 thioredoxin-disulfide reductase activity
0003674 0005488 binding
0003674 0005488 0000035 acyl binding
0003674 0005488 0043178 alcohol binding
0003674 0005488 0043178 0035276 ethanol binding
0003674 0005488 0043176 amine binding
0003674 0005488 0043176 0042166 acetylcholine binding
0003674 0005488 0043176 0042166 0015464 acetylcholine receptor activity
0003674 0005488 0043176 0042166 0015464 0016907 G-protein coupled acetylcholine receptor activity
0003674 0005488 0043176 0042166 0015464 0004981 muscarinic acetylcholine receptor activity
0003674 0005488 0043176 0016597 amino acid binding
0003674 0005488 0043176 0016597 0016595 glutamate binding
0003674 0005488 0043176 0016597 0016594 glycine binding
0003674 0005488 0043176 0051379 epinephrine binding
0003674 0005488 0043176 0051381 histamine binding
0003674 0005488 0043176 0051380 norepinephrine binding
0003674 0005488 0043176 0019808 polyamine binding
0003674 0005488 0043176 0019808 0019810 putrescine binding
0003674 0005488 0043176 0019808 0019809 spermidine binding
stdout
acetylcholine binding : 0003674 0005488 0043176 0042166 
acetylcholine receptor activity : 0003674 0005488 0043176 0042166 0015464 
acyl binding : 0003674 0005488 0000035 
alcohol binding : 0003674 0005488 0043178 
amine binding : 0003674 0005488 0043176 
amino acid binding : 0003674 0005488 0043176 0016597 
antioxidant activity : 0003674 0016209 
ascorbate peroxidase activity : 0003674 0016209 0004601 0016688 
binding : 0003674 0005488 
bromide peroxidase activity : 0003674 0016209 0004601 0019806 
catalase activity : 0003674 0016209 0004601 0004096 
chloride peroxidase activity : 0003674 0016209 0004601 0016691 
cytochrome-c peroxidase activity : 0003674 0016209 0004601 0004130 
diarylpropane peroxidase activity : 0003674 0016209 0004601 0016690 
epinephrine binding : 0003674 0005488 0043176 0051379 
ethanol binding : 0003674 0005488 0043178 0035276 
fatty-acid peroxidase activity : 0003674 0016209 0004601 0047888 
glutamate binding : 0003674 0005488 0043176 0016597 0016595 
glutathione dehydrogenase (ascorbate) activity : 0003674 0016209 0045174 
glutathione peroxidase activity : 0003674 0016209 0004601 0004602 
glutathione-disulfide reductase activity : 0003674 0016209 0004362 
glycine binding : 0003674 0005488 0043176 0016597 0016594 
histamine binding : 0003674 0005488 0043176 0051381 
iodide peroxidase activity : 0003674 0016209 0004601 0004447 
manganese peroxidase activity : 0003674 0016209 0004601 0016689 
molecular_function : 0003674 
muscarinic acetylcholine receptor activity : 0003674 0005488 0043176 0042166 0015464 0004981 
norepinephrine binding : 0003674 0005488 0043176 0051380 
peroxidase activity : 0003674 0016209 0004601 0050137 
phospholipid-hydroperoxide glutathione peroxidase activity : 0003674 0016209 0004601 0047066 
polyamine binding : 0003674 0005488 0043176 0019808 
protein coupled acetylcholine receptor activity : 0003674 0005488 0043176 0042166 0015464 0016907 
putrescine binding : 0003674 0005488 0043176 0019808 0019810 
secretory plant peroxidase activity : 0003674 0016209 0004601 0016693 
spermidine binding : 0003674 0005488 0043176 0019808 0019809 
thiol peroxidase activity : 0003674 0016209 0004601 0009031 
thioredoxin peroxidase activity : 0003674 0016209 0004601 0008379 
thioredoxin-disulfide reductase activity : 0003674 0016209 0004791 

0000035 :     1
0003674 :    40
0004096 :     1
0004130 :     1
0004362 :     1
0004447 :     1
0004601 :    17
0004602 :     1
0004791 :     1
0004981 :     1
0005488 :    18
0008379 :     1
0009031 :     1
0015464 :     3
0016209 :    21
0016594 :     1
0016595 :     1
0016597 :     3
0016688 :     1
0016689 :     1
0016690 :     1
0016691 :     1
0016692 :     1
0016693 :     1
0016907 :     1
0019806 :     1
0019808 :     3
0019809 :     1
0019810 :     1
0035276 :     1
0042166 :     4
0043176 :    14
0043178 :     2
0045174 :     1
0047066 :     1
0047888 :     1
0050137 :     1
0051379 :     1
0051380 :     1
0051381 :     1