Submission #19007

#TimeUsernameProblemLanguageResultExecution timeMemory
19007kriii동전 (kriii4_E)C++14
5 / 100
15 ms1404 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...