Submission #18097

#TimeUsernameProblemLanguageResultExecution timeMemory
18097comet동전 게임 (KOI15_coin)C++98
100 / 100
23 ms1084 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...