You are viewing a single comment's thread. Return to all comments →
HOW ABOUT THIS?
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <bitset> using namespace std; int main() { long long int t,x,y,b; cin>>t; for(long long int i=0;i<t;i++) { long long int n; cin>>n; b=0; while(n!=1) { x=n&(n-1); if(x==0) n=n/2; else { y=63; bitset <64> b1(n); while(b1[y]!=1) { y--; } n=n-pow(2,y); } b=b^1; } if(b==0) cout<<"Richard\n"; else cout<<"Louise\n"; } 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 →
HOW ABOUT THIS?