답안 #19006

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
19006 2016-02-17T02:56:00 Z kriii 동전 (kriii4_E) C++14
100 / 100
12 ms 1596 KB
#include <stdio.h>

const long long mod = 1000000007;

void add(long long &a, long long b)
{
	a = (a + b) % mod;
}

long long dyn[256][256];

int main()
{
	int N; scanf ("%d",&N); N++;

	dyn[0][0] = 1;
	for (int i=0;i<N;i++) for (int x=0;x<256;x++) if (dyn[i][x]){
		for (int k=1;i+k<=N;k++) add(dyn[i+k][x^(k-1)],dyn[i][x]);
	}
	printf ("%lld\n",dyn[N][0]);

	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1596 KB Output is correct
2 Correct 0 ms 1596 KB Output is correct
3 Correct 0 ms 1596 KB Output is correct
4 Correct 0 ms 1596 KB Output is correct
5 Correct 0 ms 1596 KB Output is correct
6 Correct 0 ms 1596 KB Output is correct
7 Correct 0 ms 1596 KB Output is correct
8 Correct 0 ms 1596 KB Output is correct
9 Correct 0 ms 1596 KB Output is correct
10 Correct 0 ms 1596 KB Output is correct
11 Correct 0 ms 1596 KB Output is correct
12 Correct 0 ms 1596 KB Output is correct
13 Correct 0 ms 1596 KB Output is correct
14 Correct 0 ms 1596 KB Output is correct
15 Correct 0 ms 1596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1596 KB Output is correct
2 Correct 4 ms 1596 KB Output is correct
3 Correct 0 ms 1596 KB Output is correct
4 Correct 0 ms 1596 KB Output is correct
5 Correct 0 ms 1596 KB Output is correct
6 Correct 0 ms 1596 KB Output is correct
7 Correct 7 ms 1596 KB Output is correct
8 Correct 10 ms 1596 KB Output is correct
9 Correct 2 ms 1596 KB Output is correct
10 Correct 9 ms 1596 KB Output is correct
11 Correct 0 ms 1596 KB Output is correct
12 Correct 0 ms 1596 KB Output is correct
13 Correct 8 ms 1596 KB Output is correct
14 Correct 2 ms 1596 KB Output is correct
15 Correct 0 ms 1596 KB Output is correct
16 Correct 0 ms 1596 KB Output is correct
17 Correct 12 ms 1596 KB Output is correct
18 Correct 0 ms 1596 KB Output is correct
19 Correct 4 ms 1596 KB Output is correct
20 Correct 0 ms 1596 KB Output is correct
21 Correct 6 ms 1596 KB Output is correct
22 Correct 4 ms 1596 KB Output is correct
23 Correct 2 ms 1596 KB Output is correct
24 Correct 0 ms 1596 KB Output is correct
25 Correct 0 ms 1596 KB Output is correct
26 Correct 0 ms 1596 KB Output is correct
27 Correct 8 ms 1596 KB Output is correct
28 Correct 0 ms 1596 KB Output is correct
29 Correct 8 ms 1596 KB Output is correct
30 Correct 12 ms 1596 KB Output is correct