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 <stdio.h>
int main(){
int k,t,x,y;
scanf("%d%d",&k,&t);
for(;t--;){
scanf("%d%d",&x,&y);
if(x>y){
--x;
if(k-x>=x-y)puts("1");
else puts("0");
}
else{
if(k-y+1>=y-x)puts("1");
else puts("0");
}
}
return 0;
}
# | 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... |