Guest User

Untitled

a guest
Jan 12th, 2014
1,303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cstdlib>
  4. #include <algorithm>
  5. #include <vector>
  6. #include <string>
  7. #include <set>
  8. #include <map>
  9. #include <cmath>
  10. #include <memory.h>
  11. #include <ext/rope>
  12. using namespace std;
  13. using namespace __gnu_cxx;
  14. typedef long long ll;
  15.  
  16. const int N = 1e6+6;
  17.  
  18.  
  19. int main(){
  20.    // freopen("input.txt","r",stdin);// freopen("output.txt","w",stdout);
  21.    
  22.     int n = 1<<20;
  23.    
  24.     rope<int> v;
  25.    
  26.     for(int i=0;i<n;++i) v.push_back(i);// else v.push_front(i);
  27.    
  28.     for(int i=0;i<11;++i) v.insert(0,v);
  29.     cout<<v.size()<<endl;
  30.    
  31.     for(int i=0;(1<<i)+i<v.size();++i) cout<<i<<": "<<v[(1<<i)+i]<<endl;
  32.    
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment