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<bits/stdc++.h>
using namespace std;
#define ll long long
//#define int ll
#define rep(n) rep1(i,n)
#define rep1(i,n) rep2(i,0,n)
#define rep2(i,a,b) for(int i=a; i<(b); ++i)
#define rep3(i,a,b) for(int i=a; i>=(b); --i)
#define pb push_back
#define pii pair<int,int>
#define sz(a) ((int)a.size())
#define all(a) a.begin(),a.end()
#define pow2(x) (1ll<<(x))
#ifdef i_am_noob
#define bug(...) cerr << "#" << __LINE__ << " " << #__VA_ARGS__ << "- ", _do(__VA_ARGS__)
template<typename T> void _do(T x){cerr << x << endl;}
template<typename T, typename ...S> void _do(T x, S... y){cerr << x << ", ";_do(y...);}
#else
#define bug(...) 49
#endif
const int maxn=2005,mod=1000000007;
int n=2000,dp[maxn][maxn],ans[maxn];
void add(int& x, int y){
x+=y;
if(x>=mod) x-=mod;
}
signed main(){
ios_base::sync_with_stdio(0),cin.tie(0);
dp[1][0]=1;
rep2(i,1,n+1) rep1(j,n+1){
if(2*i-j>=0&&2*i-j<maxn) add(dp[2*i-j][i],dp[i][j]);
if(i+j+1>=0&&i+j+1<maxn) add(dp[i+j+1][j],dp[i][j]);
add(ans[i],dp[i][j]);
}
rep2(i,1,n+1) cout << ans[i] << "\n" << -1 << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |