Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <math.h>
- #include <iostream>
- #include <iso646.h>
- //#include <vector>
- using namespace std;
- int main(){
- unsigned int tmp=0;
- int v[10]={0,0,0,0,0,0,0,0,0,0};
- bool x[100031];
- for(int i=0; i<100031; i++)
- x[i]=0;
- x[1]=1;
- x[2]=1;
- x[3]=1;
- x[5]=1;
- x[6]=1;
- bool temp[7];
- unsigned int all[100000];
- for(int i=7; i<100031; i++)
- x[i]=x[i-3]^x[i-7];
- for(int i=0; i<100000; i++){
- for(int b=0; b<31; b++)
- tmp+=x[i+b]*pow(2.0f, b);
- all[i]=tmp;
- tmp=0;
- if(i==1000)
- i=i;
- if(all[i]<2147483647/10)
- v[0]++;
- else if(all[i]<2*(2147483647/10))
- v[1]++;
- else if(all[i]<3*(2147483647/10))
- v[2]++;
- else if(all[i]<4*(2147483647/10))
- v[3]++;
- else if(all[i]<5*(2147483647/10))
- v[4]++;
- else if(all[i]<6*(2147483647/10))
- v[5]++;
- else if(all[i]<7*(2147483647/10))
- v[6]++;
- else if(all[i]<8*(2147483647/10))
- v[7]++;
- else if(all[i]<9*(2147483647/10))
- v[8]++;
- else
- v[9]++;
- }
- for(int i=0; i<10; i++)
- cout << v[i] << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement