#include <cstdio>
#include <map>
const int p = 1000000007;
using namespace std;
int pw(int x, int y)
{
return y & 1 ? (long long)pw(x, y ^ 1)*x%p : y ? pw((long long)x*x%p, y >> 1) : 1;
}
int a[255];
int d[255][555];
int main()
{
int i, j, k, n;
scanf("%d", &n);
a[0] = 0;
d[0][0] = 1;
a[1] = 1;
d[1][0] = 1;
d[1][1] = 1;
for (i = 2; i <= n; i++)
{
for (j = 0; j < i; j++) for (k = 0; k < 555; k++) (d[i][k ^ a[j]] += d[i - j - 1][k]) %= p;
for (a[i] = 0; d[i][a[i]]; a[i]++);
d[i][a[i]] = 1;
}
printf("%d", d[n][0]);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1636 KB |
Output is correct |
2 |
Correct |
0 ms |
1636 KB |
Output is correct |
3 |
Correct |
0 ms |
1636 KB |
Output is correct |
4 |
Correct |
0 ms |
1636 KB |
Output is correct |
5 |
Correct |
0 ms |
1636 KB |
Output is correct |
6 |
Correct |
0 ms |
1636 KB |
Output is correct |
7 |
Correct |
0 ms |
1636 KB |
Output is correct |
8 |
Correct |
0 ms |
1636 KB |
Output is correct |
9 |
Correct |
0 ms |
1636 KB |
Output is correct |
10 |
Correct |
0 ms |
1636 KB |
Output is correct |
11 |
Correct |
0 ms |
1636 KB |
Output is correct |
12 |
Correct |
0 ms |
1636 KB |
Output is correct |
13 |
Correct |
0 ms |
1636 KB |
Output is correct |
14 |
Correct |
0 ms |
1636 KB |
Output is correct |
15 |
Correct |
0 ms |
1636 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
1636 KB |
Output is correct |
2 |
Correct |
43 ms |
1636 KB |
Output is correct |
3 |
Correct |
0 ms |
1636 KB |
Output is correct |
4 |
Correct |
12 ms |
1636 KB |
Output is correct |
5 |
Correct |
7 ms |
1636 KB |
Output is correct |
6 |
Correct |
17 ms |
1636 KB |
Output is correct |
7 |
Correct |
65 ms |
1636 KB |
Output is correct |
8 |
Correct |
80 ms |
1636 KB |
Output is correct |
9 |
Correct |
24 ms |
1636 KB |
Output is correct |
10 |
Correct |
76 ms |
1636 KB |
Output is correct |
11 |
Correct |
10 ms |
1636 KB |
Output is correct |
12 |
Correct |
13 ms |
1636 KB |
Output is correct |
13 |
Correct |
72 ms |
1636 KB |
Output is correct |
14 |
Correct |
47 ms |
1636 KB |
Output is correct |
15 |
Correct |
24 ms |
1636 KB |
Output is correct |
16 |
Correct |
4 ms |
1636 KB |
Output is correct |
17 |
Correct |
91 ms |
1636 KB |
Output is correct |
18 |
Correct |
3 ms |
1636 KB |
Output is correct |
19 |
Correct |
41 ms |
1636 KB |
Output is correct |
20 |
Correct |
8 ms |
1636 KB |
Output is correct |
21 |
Correct |
58 ms |
1636 KB |
Output is correct |
22 |
Correct |
45 ms |
1636 KB |
Output is correct |
23 |
Correct |
30 ms |
1636 KB |
Output is correct |
24 |
Correct |
15 ms |
1636 KB |
Output is correct |
25 |
Correct |
10 ms |
1636 KB |
Output is correct |
26 |
Correct |
3 ms |
1636 KB |
Output is correct |
27 |
Correct |
72 ms |
1636 KB |
Output is correct |
28 |
Correct |
0 ms |
1636 KB |
Output is correct |
29 |
Correct |
70 ms |
1636 KB |
Output is correct |
30 |
Correct |
95 ms |
1636 KB |
Output is correct |