Submission #7690

#TimeUsernameProblemLanguageResultExecution timeMemory
7690gs13068CATS (NOI14_cats)C++98
25 / 25
100 ms1088 KiB
#include<cstdio> int main() { int Q; scanf("%d",&Q); while(Q--) { long long X,L,N,K,T,C=0; scanf("%lld%lld%lld",&X,&L,&N); X=X-1; K=(L+2*N-1)/(2*N)*(2*N); for(T=K/(2*N)+1;X>0&&T>0;X>>=1,T--)C^=X&1; printf("%lld\n",K+C); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...