# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
19007 | | kriii | 동전 (kriii4_E) | C++14 | | 15 ms | 1404 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>
int N; int range[1<<16]; bool win[1<<16];
int main()
{
scanf ("%d",&N);
for (int i=1;i<(1<<N);i++){
int r = i, x = i & (-i), l;
while (r){
l = r & (-r);
r -= l;
}
range[i] = l * 2 - i;
}
for (int i=(1<<N)-2;i>=0;i--){
int rem = (1<<N) - 1 - i;
for (int j=rem;j;j=(j-1)&rem){
if (range[j] & i) continue;
if (!win[i+j]){win[i] = 1; break;}
}
}
int ans = 0;
for (int i=0;i<(1<<N);i++) if (!win[i]) ans++;
printf ("%d\n",ans);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |