Advertisement
Guest User

std::map performance test

a guest
Jun 13th, 2011
578
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include<cstdio>
  2. #include<set>
  3. #include<map>
  4. using namespace std;
  5. int main(void){
  6.     long long int ps=1;
  7.     long long mod=(1LL<<31LL)-1LL;
  8.     map<long long, long long> tset;
  9.     for (int k=0; k<5000000; k++){
  10.     tset[ps]=ps%((1<<17)-1);
  11.     ps=((1<<7)-1)*ps+((1<<5)-1);
  12.     ps%=mod;
  13.     //if (!(k%100000))
  14.     if (tset[ps]>0)
  15.         puts("YAY!");
  16.    
  17.    
  18.     }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement