Submission #18443

#TimeUsernameProblemLanguageResultExecution timeMemory
18443chan492811동전 게임 (KOI15_coin)C++98
100 / 100
24 ms1084 KiB
#include <cstdio> #include <algorithm> using namespace std; int n,m; int main(){ int i,a,s,l; scanf("%d %d",&n,&m); for(i=0;i<m;i++){ scanf("%d %d",&a,&s); if(a>s) a--; l=n-max(a,s); if(s>a){ if(s-a<=l+1) printf("1\n"); else printf("0\n"); }else{ if(a-s<=l) printf("1\n"); else printf("0\n"); } } return 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...