This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
int main()
{
long long tc;
scanf("%lld",&tc);
while(tc--)
{
long long t=0;
long long i,j,x,l,n;
scanf("%lld%lld%lld",&x,&l,&n);
n<<=1;
i=(l+n-1)/n;
if(i>60)j=62;
else if(i>1)j=i+1;
else j=2;
x=(x-1)&((1<<j)-1);
if(i*n==l)
{
}
else
{
for(x=(x-1)&((1<<j)-1);x;x>>=1)t^=x&1;
printf("%lld\n",i*n+t);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |