Advertisement
Guest User

Untitled

a guest
Jan 12th, 2014
1,058
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 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 = 51;
  23.    
  24.     vector<rope<int> > f(n);
  25.    
  26.     f[0] = rope<int>(0);
  27.     f[1] = rope<int>(1);
  28.    
  29.     for(int i=2;i<n;++i){
  30.         f[i] = f[i-2];
  31.         f[i].insert(0, f[i-1]);
  32.         cout<<i<<": "<<f[i].size()<<' '<<f[i][f[i].size()/2]<<endl;
  33.        
  34.     }
  35.    
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement