# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
113258 | arnold518 | 동전 게임 (KOI15_coin) | C++14 | 30 ms | 1280 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |