Submission #58400

#TimeUsernameProblemLanguageResultExecution timeMemory
58400andy627동전 게임 (KOI15_coin)C++17
100 / 100
45 ms5312 KiB
#include <stdio.h> #include <algorithm> using namespace std; int n,m; void solve(){ int a,b; scanf("%d %d",&a,&b); if(a>b && (a-1)-b<=n-(a-1)) printf("1\n"); else if(a<=b && (b-1)-a<=n-b) printf("1\n"); else printf("0\n"); } int main(){ scanf("%d %d",&n,&m); while(m--) solve(); return 0; }

Compilation message (stderr)

coin.cpp: In function 'void solve()':
coin.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",&a,&b);
     ~~~~~^~~~~~~~~~~~~~~
coin.cpp: In function 'int main()':
coin.cpp:18:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...