You are viewing a single comment's thread. Return to all comments →
what's the problem in this for big integer answer is wrong almost 20 digits
for(i=1;i<=t;i++) { c=0; unsigned long n; cin>>n; while(n!=1) { c++; if(log2(n)-int(log2(n))!=0) { n=n-pow(2,int(log2(n))); } else { n=n/2; } } if(c%2==0) { cout<<"Richard"<<endl; } else if(c==0) { cout<<"Richard"<<endl; } else { cout<<"Louise"<<endl; } }
Counter game
You are viewing a single comment's thread. Return to all comments →
what's the problem in this for big integer answer is wrong almost 20 digits
-