답안 #19869

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
19869 2016-02-25T06:25:18 Z xdoju 동전 (kriii4_E) C++14
100 / 100
30 ms 1348 KB
#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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1348 KB Output is correct
2 Correct 0 ms 1348 KB Output is correct
3 Correct 0 ms 1348 KB Output is correct
4 Correct 0 ms 1348 KB Output is correct
5 Correct 0 ms 1348 KB Output is correct
6 Correct 0 ms 1348 KB Output is correct
7 Correct 0 ms 1348 KB Output is correct
8 Correct 0 ms 1348 KB Output is correct
9 Correct 0 ms 1348 KB Output is correct
10 Correct 0 ms 1348 KB Output is correct
11 Correct 0 ms 1348 KB Output is correct
12 Correct 0 ms 1348 KB Output is correct
13 Correct 0 ms 1348 KB Output is correct
14 Correct 0 ms 1348 KB Output is correct
15 Correct 0 ms 1348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1348 KB Output is correct
2 Correct 14 ms 1348 KB Output is correct
3 Correct 0 ms 1348 KB Output is correct
4 Correct 4 ms 1348 KB Output is correct
5 Correct 0 ms 1348 KB Output is correct
6 Correct 6 ms 1348 KB Output is correct
7 Correct 21 ms 1348 KB Output is correct
8 Correct 26 ms 1348 KB Output is correct
9 Correct 8 ms 1348 KB Output is correct
10 Correct 25 ms 1348 KB Output is correct
11 Correct 5 ms 1348 KB Output is correct
12 Correct 4 ms 1348 KB Output is correct
13 Correct 23 ms 1348 KB Output is correct
14 Correct 15 ms 1348 KB Output is correct
15 Correct 8 ms 1348 KB Output is correct
16 Correct 2 ms 1348 KB Output is correct
17 Correct 29 ms 1348 KB Output is correct
18 Correct 1 ms 1348 KB Output is correct
19 Correct 10 ms 1348 KB Output is correct
20 Correct 0 ms 1348 KB Output is correct
21 Correct 18 ms 1348 KB Output is correct
22 Correct 14 ms 1348 KB Output is correct
23 Correct 10 ms 1348 KB Output is correct
24 Correct 6 ms 1348 KB Output is correct
25 Correct 0 ms 1348 KB Output is correct
26 Correct 1 ms 1348 KB Output is correct
27 Correct 23 ms 1348 KB Output is correct
28 Correct 0 ms 1348 KB Output is correct
29 Correct 22 ms 1348 KB Output is correct
30 Correct 30 ms 1348 KB Output is correct