Submission #21283

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
212832017-04-12 07:08:31suzy동전 (kriii4_E)C++11
100 / 100
69 ms62888 KiB
#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));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

D.cpp: In function 'int main()':
D.cpp:32:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
                   ^

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...