# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
134102 | ansol4328 | 동전 게임 (KOI15_coin) | C++11 | 28 ms | 1272 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<stdio.h>
#include<algorithm>
using namespace std;
int k, n;
int a, b;
int main()
{
scanf("%d %d",&k,&n);
for(int i=1 ; i<=n ; i++)
{
scanf("%d %d",&a,&b);
int mval=min(a,b);
a-=mval, b-=mval;
int x=k-mval;
if((a<=(x+2)/2 && b==0) || (a==0 && b<=(x+1)/2)) printf("1\n");
else printf("0\n");
}
return 0;
}
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... |