Submission #320983

#TimeUsernameProblemLanguageResultExecution timeMemory
320983tjdgus4384동전 게임 (KOI15_coin)C++14
100 / 100
26 ms1260 KiB
#include<bits/stdc++.h> using namespace std; int K, C, M, N; int main(){ scanf("%d %d", &K, &C); for(int i = 0;i < C;i++){ scanf("%d %d", &M, &N); if(M < N){ if(N*2 > (K+1+M)) printf("0\n"); else printf("1\n"); } if(M == N) printf("1\n"); if(M > N){ if(M*2 > (K+N+2)) printf("0\n"); else printf("1\n"); } } }

Compilation message (stderr)

coin.cpp: In function 'int main()':
coin.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    6 |     scanf("%d %d", &K, &C);
      |     ~~~~~^~~~~~~~~~~~~~~~~
coin.cpp:8:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    8 |         scanf("%d %d", &M, &N);
      |         ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...