Advertisement
nullzero

compressed

Oct 27th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <cstdio>
  2. #include <map>
  3.  
  4. using namespace std;
  5.  
  6. map<int,int> compressed;
  7.  
  8. int main(){
  9.     int n;
  10.    
  11.     // read input here
  12.    
  13.     compressed[-123] = 0;
  14.     compressed[-123123123] = 0;
  15.     compressed[321321] = 0;
  16.     compressed[32132112] = 0;
  17.     compressed[0] = 0;
  18.    
  19.     // end read input
  20.    
  21.     int cnt = 0;
  22.     for(map<int,int>::iterator it = compressed.begin(); it != compressed.end(); ++it) it->second = cnt++;
  23.    
  24.     compressed[-123123123] => 0
  25.     compressed[-123] => 1
  26.     compressed[0] => 2
  27.     compressed[321321] => 3
  28.     compressed[32132112] => 4
  29.    
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement