# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
7691 |
2014-08-14T12:01:52 Z |
gs13068 |
CATS (NOI14_cats) |
C++ |
|
92 ms |
1088 KB |
#include<cstdio>
int main()
{
int Q;
scanf("%d",&Q);
while(Q--)
{
long long X,L,N,K,T,C;
scanf("%lld%lld%lld",&X,&L,&N);
X=X-1;
T=(L+2*N-1)/(2*N);
K=T*(2*N);
for(C=0;X>0&&T>=0;X>>=1,T--)C^=X&1;
printf("%lld\n",K+C);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1088 KB |
Output is correct |
2 |
Correct |
0 ms |
1088 KB |
Output is correct |
3 |
Correct |
0 ms |
1088 KB |
Output is correct |
4 |
Correct |
0 ms |
1088 KB |
Output is correct |
5 |
Correct |
0 ms |
1088 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1088 KB |
Output is correct |
2 |
Correct |
0 ms |
1088 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1088 KB |
Output is correct |
2 |
Correct |
0 ms |
1088 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1088 KB |
Output is correct |
2 |
Correct |
0 ms |
1088 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
1088 KB |
Output is correct |
2 |
Correct |
8 ms |
1088 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
84 ms |
1088 KB |
Output is correct |
2 |
Correct |
92 ms |
1088 KB |
Output is correct |