This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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]);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |