# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
113258 | 2019-05-24T13:19:37 Z | arnold518 | 동전 게임 (KOI15_coin) | C++14 | 30 ms | 1280 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 3 ms | 384 KB | Output is correct |
4 | Correct | 21 ms | 888 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 384 KB | Output is correct |
2 | Correct | 3 ms | 384 KB | Output is correct |
3 | Correct | 15 ms | 768 KB | Output is correct |
4 | Correct | 23 ms | 1020 KB | Output is correct |
5 | Correct | 27 ms | 1280 KB | Output is correct |
6 | Correct | 29 ms | 1276 KB | Output is correct |
7 | Correct | 30 ms | 1280 KB | Output is correct |
8 | Correct | 29 ms | 1268 KB | Output is correct |