이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//*
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<algorithm>
#include<vector>
#define all(A) (A).begin(), (A).end()
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int MN = 1000;
const ll mod = 1000000007;
int N;
ll D[MN][MN];
int main(){
scanf("%d",&N);
D[0][0]=1;
D[1][0]=D[1][1]=1;
for(int i=2;i<=N;i++)for(int j=0;j<MN;j++){
if(i==j){
D[i][j]++;
}
for(int k=0;k<i;k++){
D[i][j]+=D[i-k-1][j^k];
D[i][j]%=mod;
}
}
printf("%lld\n",D[N][0]);
return 0;
}
//*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |