You are viewing a single comment's thread. Return to all comments →
can anyone tell the error in this code??? i guess my logic is correct but m failing for almost half of the test cases
int main() {
int t; cin>>t; for(int i=0;i<t;i++) { unsigned long long int n; cin>>n; int count=0; while(n!=1) { float f=log2(n); if(f>(int)f) n=n-pow(2,int(f)); else n=n/2; count++; } if(count%2!=0) cout<<"Louise"<<endl; else cout<<"Richard"<<endl; } return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Counter game
You are viewing a single comment's thread. Return to all comments →
can anyone tell the error in this code??? i guess my logic is correct but m failing for almost half of the test cases
int main() {
}