| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 365988 | ahmedfouadnew | Football (info1cup20_football) | C++17 | 54 ms | 16364 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;
#define s second
#define f first
#define pb push_back
//#define int long long
int dp[1001][1001][2];
int fun(int x,int curk,bool t)
{
if(x==0) return !t;
int &ret=dp[x][curk][t];
if(~ret)
return ret;
if(!t)
{
for(int i=1;i<=min(x,curk);i++)
{
if(fun(x-i,i,!t)==0)
{
return ret=0;
}
}
return ret=1;
}
else
{
for(int i=1;i<=min(x,curk);i++)
{
if(fun(x-i,i,!t)==1)
{
return ret=1;
}
}
return ret=0;
}
}
signed main()
{
memset(dp,-1,sizeof dp);
string ans="";
int t;
cin>>t;
while(t--)
{
int n,k,x;
cin>>n>>k;
cin>>x;
ans+='0'+fun(x,k,1);
}
cout<<ans<<endl;
return 0;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
