We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#include<cmath>#include<cstdio>#include<vector>#include<iostream>#include<algorithm>usingnamespacestd;intmain(){intt,cnt;unsignedlonglongintn;cin>>t;for(inti=0;i<t;i++){cnt=0;scanf("%llu",&n);if(n==1){cout<<"Richard"<<endl;continue;}while(n>1){if((n&1)==0){n=n/2;}else{while(n&(n-1)){n=n&(n-1);}//n=n&(n-1);n=n/2;}cnt++;}if(cnt%2==0)cout<<"Richard"<<endl;elsecout<<"Louise"<<endl;}/* Enter your code here. Read input from STDIN. Print output to STDOUT */return0;}
can you explain me please why my code is not working?
Cookie support is required to access HackerRank
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 you explain me please why my code is not working?