Submission #113258

#TimeUsernameProblemLanguageResultExecution timeMemory
113258arnold518동전 게임 (KOI15_coin)C++14
100 / 100
30 ms1280 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; int p, k; int main() { int i, j; scanf("%d%d", &k, &p); while(p--) { int a, b; scanf("%d%d", &a, &b); if(k==1 || (a==0 && b==0) || (a==b)) { printf("1\n"); continue; } if(a>b) { a--; int t=a; t=k-t; if(b+t<a) printf("0"); else printf("1"); } else { b--; int t=b; t=k-t-1; if(a+t<b) printf("0"); else printf("1"); } printf("\n"); } }

Compilation message (stderr)

coin.cpp: In function 'int main()':
coin.cpp:13:9: warning: unused variable 'i' [-Wunused-variable]
     int i, j;  
         ^
coin.cpp:13:12: warning: unused variable 'j' [-Wunused-variable]
     int i, j;  
            ^
coin.cpp:14:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &k, &p);  
     ~~~~~^~~~~~~~~~~~~~~~
coin.cpp:18:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d", &a, &b);  
         ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...