Submission #19869

#TimeUsernameProblemLanguageResultExecution timeMemory
19869xdoju동전 (kriii4_E)C++14
100 / 100
30 ms1348 KiB
#include <stdio.h> const int MOD = 1000000007; int dp[260][260]; int main(){ int N; scanf("%d", &N); dp[0][0] = 1; for(int i = 1; i <= N; i++){ for(int j = 0; j < i; j++){ // number of 1 for(int k = 0; k < 256; k++){ dp[i][j ^ k] += dp[i - j - 1][k]; dp[i][j ^ k] %= MOD; } } for(int k = 0; k < 256; k++){ dp[i][i ^ k] += dp[0][k]; dp[i][i ^ k] %= MOD; } } printf("%d\n", dp[N][0]); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...