# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
51636 | okaybody10 | 동전 게임 (KOI15_coin) | C++98 | 57 ms | 2332 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;
bool check[1006][1006];
int main()
{
int k; scanf("%d",&k);
for(int i=0;i<=k;i++)
{
for(int j=0;j<=k;j++)
{
if (i<=j&&j>i+(k-i+1)/2||i>j&&i>j+(k-j)/2+1) check[i][j]=false;
else check[i][j]=true;
}
}
/*check[k][k]=true;
check[k][(k+1)/2]=true;
for(int i=k-1;i>=0;i--)
{
if(i>=(k-1)/2) check[k][i]=true;
}
for(int i=k-1;i>=0;i--) if(i>=(k+1)/2) check[i][k]=true;*/
int c; scanf("%d",&c);
while(c--)
{
int n,m; scanf("%d %d",&n,&m); printf("%d\n",check[n][m]);
}
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... |