# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
21283 | suzy | 동전 (kriii4_E) | C++11 | 69 ms | 62888 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 <string.h>
#define MOD 1000000007
int g[251];
int gr(int n) {
if(n==0) return 0;
if(g[n]>=0) return g[n];
bool v[251]={false};
for(int i=1;i<=n;i++) {
for(int j=i;j<=n;j++)
v[gr(i-1)^gr(n-j)]=true;
}
int res=0;
while(v[res]) res++;
return g[n]=res;
}
int d[251][251][251];
int f(int gn, int c, int k) {
if(k==0) return (gn^gr(c))==0;
if(d[gn][c][k]>=0) return d[gn][c][k];
return d[gn][c][k]=(f(gn,c+1,k-1)+f(gn^gr(c),0,k-1))%MOD;
}
int main() {
memset(g,-1,sizeof(g));
memset(d,-1,sizeof(d));
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |