이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
int N,Q;
int max(int x,int y){return x>y?x:y;}
bool chk(int x,int y,bool delta){
x=max(0,x),y=max(0,y);
int round=max(x,y);
if((N-round)+x-delta<y)return 0;
if(x>(N-round)+y)return 0;
return 1;
}
int main(){
scanf("%d",&N);
scanf("%d",&Q);
int x,y;
for(int i=0;i<Q;i++){
scanf("%d%d",&x,&y);
if(chk(x-1,y,0)||chk(x,y-1,1)||chk(x,y,0))puts("1");
else puts("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... |