Submission #389359

# Submission time Handle Problem Language Result Execution time Memory
389359 2021-04-14T03:35:53 Z i_am_noob Binary Subsequences (info1cup17_binary) C++17
12.9 / 100
61 ms 16036 KB
#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+2) rep1(j,n+2){
        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,2,n+2) cout << ans[i] << "\n" << -1 << "\n";
}
# Verdict Execution time Memory Grader output
1 Partially correct 60 ms 16004 KB Output is partially correct
# Verdict Execution time Memory Grader output
1 Incorrect 59 ms 16036 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 61 ms 16028 KB Output isn't correct
2 Halted 0 ms 0 KB -