criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

ll a[5003], b[202][5003], d[5003][5003];

int main() {
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    for (int i = 1; i < n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) cin >> b[j][i];
    for (int i = 1; i <= m; i++) {
        int l[5003] = {}, r[5003] = {};
        vector<int> s = {0};
        b[i][0] = b[i][n + 1] = mod;
        for (int j = 1; j <= n; j++) {
            while (b[i][s.back()] <= b[i][j]) s.pop_back();
            l[j] = s.back();
            s.push_back(j);
        }
        s = {n + 1};
        for (int j = n; j; j--) {
            while (b[i][s.back()] < b[i][j]) s.pop_back();
            r[j] = s.back();
            s.push_back(j);
        }
        for (int j = 1; j <= n; j++) cout << l[j] << ' ' << r[j] << '\n';
        for (int j = 1; j <= n; j++) d[l[j] + 1][r[j] + 1] = 1;
    }
    return;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   33 |     return;
      |     ^~~~~~
Language: C++

#include<bits/stdc++.h>
//ios::sync_with_stdio(false);
//cin.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll beki(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k%2==1){
            ret*=now;
            ret%=mod;
        }
        now*=now;
        now%=mod;
        k/=2;
    }
    return ret;
}
ll gyaku(ll n){
    return beki(n,mod-2);
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n;cin>>n;
    ll a,b,c,d;cin>>a>>b>>c>>d;
    ll dp[n+1][n+1];
    rep(i,0,n+1)rep(j,0,n+1)dp[i][j]=0;
    dp[a-1][0]=1;
    ll nck[1001][1001];
    rep(i,0,1001)nck[i][0]=1;
    rep(i,0,1001)nck[i][i]=1;
  gya[1001];
  rep(i,1,1001)gya[i]=gyaku(i);
    rep(i,1,1001){
        rep(j,1,i){
            nck[i][j]=nck[i-1][j-1]+nck[i-1][j];
            nck[i][j]%=mod;
        }
    }
    rep(i,a-1,b){
        int t=0;
        rep(j,0,n+1){
            dp[i+1][j]+=dp[i][j];
            dp[i+1][j]%=mod;
            if(t==1)continue;
            ll sum=1;
            ll now=n-j;
            rep(k,0,c){
                if(now<0){
                    sum=-1;
                    break;
                }
                sum*=nck[now][i+1];
                sum%=mod;
                sum*=gya[k+1];
                sum%=mod;
                now-=i+1;
                
            }
            if(sum==-1){
                t=1;
                continue;
            }
            rep(k,c,d+1){
                if(j+(i+1)*k>n)break;
                dp[i+1][j+(i+1)*k]+=dp[i][j]*sum;
                dp[i+1][j+(i+1)*k]%=mod;
                sum*=nck[n-(j+(i+1)*k)][i+1];
                sum%=mod;
                sum*=gya[k+1];
                sum%=mod;
            }
            
        }
    }
    cout<<dp[b][n]<<endl;
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:66:3: error: 'gya' was not declared in this scope
   66 |   gya[1001];
      |   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
ll fc[200010];
ll ifc[200010];

ll add(ll x, ll y){return (x+y)%MOD;}
ll mlt(ll x, ll y){return (x*y)%MOD;}
ll power(ll x, ll n){
  ll ans=1;
  while(n>0){
    if(n%2!=0)ans=mlt(ans, x);
    x=mlt(x,x);n/=2;
  }
  return ans;
}

ll inv(ll x){return power(x, MOD-2);}

void fct(){
  fc[0]=1;
  for (int i=0;i<200009;++i){fc[i+1]=mlt(fc[i], i+1);}
}

void ifct(){
  ifc[200009]=inv(fct[200009]);
  for (i=200009;i>=1;--i){ifc[i-1]=mlt(ifc[i], i);}
}

ll comb(int n, int k){return mlt(fc[n], mlt(ifc[k], ifc[n-k]));}

int main(){
  int N, A, B, C, D;cin>>N>>A>>B>>C>>D;

  fct();ifct();
  dp[1010][1010]={};dp[N][A-1]=1;

  for (int j=A;j<=B;++j){
    for (int i=N;i>=0;--i){
      dp[i][j]=dp[i][j-1];

      ll factor=1;
      for (int k=0;k++<C-1;){
        factor=mlt(factor, comb(i+j*k, j));
      }

      for (int k=C;k<=D;++k){
        if(i+j*k>N) break;
        factor=mlt(factor, comb(i+j*k,j));
        dp[i][j]=add(dp[i][j], mlt(dp[i+j*k][j-1],mlt(factor, ifc[k])));
      }
    }
  }

  cout << dp[0][B] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'void ifct()':
a.cc:27:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   27 |   ifc[200009]=inv(fct[200009]);
      |                             ^
a.cc:27:29: error: invalid conversion from 'void (*)()' to 'll' {aka 'long long int'} [-fpermissive]
   27 |   ifc[200009]=inv(fct[200009]);
      |                   ~~~~~~~~~~^
      |                             |
      |                             void (*)()
a.cc:19:11: note:   initializing argument 1 of 'll inv(ll)'
   19 | ll inv(ll x){return power(x, MOD-2);}
      |        ~~~^
a.cc:28:8: error: 'i' was not declared in this scope
   28 |   for (i=200009;i>=1;--i){ifc[i-1]=mlt(ifc[i], i);}
      |        ^
a.cc: In function 'int main()':
a.cc:37:3: error: 'dp' was not declared in this scope; did you mean 'dup'?
   37 |   dp[1010][1010]={};dp[N][A-1]=1;
      |   ^~
      |   dup
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll MOD=1e9+7;

//factorial&inverse factorial
ll fc[200010];
ll ifc[200010];

ll add(ll x, ll y){return (x+y)%MOD;}
ll mlt(ll x, ll y){return (x*y)%MOD;}

ll power(int x, int n){
  ll ans=1;
  while(n>0){
    if(n%2!=0){ans=mlt(ans, x);}
    x=mlt(x,x);
    n/=2;
  }
  return ans;
}

ll inv(ll x){
  return power(x, MOD-2);
}

void fct(){
  fc[0]=0;
  for (int i=0;i<200009;++i){
    fc[i+1]=mlt(fc[i], i+1);
  }
}

void ifct(){
  ifc[200009]=inv(fc[200009]);
  for (int i=200009;i>=1;--i){
    ifc[i-1]=mlt(ifc[i], i);
  }
}

ll comb(int n, int k){
  if(n<0||k<0|| k>n)return 0;
  return mlt(fct[n], mlt(ifc[k], ifc[n-k]));
}

int main(){
  int N, A, B, C, D;cin>>N>>A>>B>>C>>D;

  ll dp[1010][1010]={};
  dp[N][A-1]=1;
  fct();ifct();

  for (int i=0;i<=N;++i){
    for (int j=A;j<=B;++j){
      dp[i][j]=dp[i][j-1];
      ll factor=1;
      for (int k=0;k++<C;){
        factor=mlt(factor, comb(i+k*j, j));
      }

      for (int k=C;k<=D;++k){
        if(i+k*j>N) break;
        factor=mlt(factor, comb(i+k*j, j));
        dp[i][j]=ad(dp[i][j], mlt(dp[i+k*j][j-1], comb(i+k*j, j)));
      }
    }
  }

  cout << dp[0][B]<< endl;
  return 0;
}


Compiler output:
a.cc: In function 'll comb(int, int)':
a.cc:44:19: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   44 |   return mlt(fct[n], mlt(ifc[k], ifc[n-k]));
      |                   ^
a.cc:44:19: error: invalid conversion from 'void (*)()' to 'll' {aka 'long long int'} [-fpermissive]
   44 |   return mlt(fct[n], mlt(ifc[k], ifc[n-k]));
      |              ~~~~~^
      |                   |
      |                   void (*)()
a.cc:12:11: note:   initializing argument 1 of 'll mlt(ll, ll)'
   12 | ll mlt(ll x, ll y){return (x*y)%MOD;}
      |        ~~~^
a.cc: In function 'int main()':
a.cc:65:18: error: 'ad' was not declared in this scope; did you mean 'add'?
   65 |         dp[i][j]=ad(dp[i][j], mlt(dp[i+k*j][j-1], comb(i+k*j, j)));
      |                  ^~
      |                  add
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

#define fr(i,n) for(int i=0;i<(n);i++)
#define Fr(i,n) for(int i=0;i++<(n);)
#define ifr(i,n) for(int i=(n)-1;i>=0;i--)
#define iFr(i,n) for(int i=(n);i>0;i--)

const ll MOD=1e9+7;

//足し算してmodをとる
ll ad(ll x,ll y=0){
    return (x+y)%MOD;
}

//mod _mult
ll mlt(ll x,ll y){
    return (x*y)%MOD;
}

 //xのy条
ll pwr(ll x,ll n){
    ll v=1;
    while(n>0){
      if (n%2==1) v=mlt(v, x);
      x=mlt(x,x);
      n/=2;
    }
    return v;
}

 //フェルマーの小定理に夜と、　x^(mod-2)=-1
ll inv(ll x){
    return pwr(x,MOD-2);
}

 //factorial
ll fc[200010];
void fct(){
    fc[0]=1;
    for (int i=0;i<200008;++i){
      fc[i+1]=mlt(fc[i], i+1);
    }
}

 //inverse_factorial
ll ifc[200010];
void ifct(ll x){
    ifc[200009]=inv(fc[200009]);
    for (int i=200009;i>=1;--i) ifc[i-1]=mlt(ifc[i], i);
}

ll comb(ll n,ll r){
    if(n<0 || r<0 || n<r) return 0;
    return mlt(fc[n],mlt(ifc[r],ifc[n-r]));
}

int main(){
    ll n,a,b,c,d,f;
    cin>>n>>a>>b>>c>>d;
    ll dp[1010][1010]={};
    fct();
    ifct();
    
    dp[b+1][n]=1;
    for(ll i=b;i>=a;i--){
        //cout << i << endl;
        fr(j,n+1){
            dp[i][j]=ad(dp[i][j],dp[i+1][j]);
            f=1;
            Fr(k,c-1) f=mlt(f,comb(j+k*i,i));
            for(ll k=c;k<=d;k++){
                if(j+i*k>n) break;
                f=mlt(f,comb(j+k*i,i));
                dp[i][j]=ad(dp[i][j],mlt(dp[i+1][j+i*k],mlt(f,ifct(k))));
            }
        }
    }
    /*for(int i=2;i<4;i++){
        fr(j,8) cout<<dp[i][j]<<" ";
        cout<<endl;
    }*/
    cout<<dp[a][0]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:9: error: too few arguments to function 'void ifct(ll)'
   64 |     ifct();
      |     ~~~~^~
a.cc:49:6: note: declared here
   49 | void ifct(ll x){
      |      ^~~~
a.cc:76:67: error: invalid use of void expression
   76 |                 dp[i][j]=ad(dp[i][j],mlt(dp[i+1][j+i*k],mlt(f,ifct(k))));
      |                                                               ~~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

#define fr(i,n) for(int i=0;i<(n);i++)
#define Fr(i,n) for(int i=0;i++<(n);)
#define ifr(i,n) for(int i=(n)-1;i>=0;i--)
#define iFr(i,n) for(int i=(n);i>0;i--)

const ll MOD=1e9+7;

//足し算してmodをとる
ll ad(ll x,ll y=0){
    return (x+y)%MOD;
}

//mod _mult
ll mlt(ll x,ll y=1){
    return (x*y)%MOD;
}

 //xのy条
ll pwr(ll x,ll n){
    ll v=1;
    while(n>0){
      if (n%2==1) v=mlt(v, x);
      x=mlt(x,x);
      n/=2;
    }
    return v;
}

 //フェルマーの小定理に夜と、　x^(mod-2)=-1
ll inv(ll x){
    return pwr(x,MOD-2);
}

 //factorial
ll fc[200010];
ll fct(){
    fc[0]=1;
    for (int i=0;i<200008){
      fc[i+1]=mlt(fc[i], i+1);
    }
}

 //inverse_factorial
ll ifc[200010];
ll ifct(ll x){
    ifc[200009]=inv(fc[200009]);
    for (int i=200009;i>=1;--i) ifc[i-1]=mlt(ifc, i);
}

ll comb(ll n,ll r){
    if(n<0 || r<0 || n<r) return 0;
    return mlt(fct(n),mlt(ifct(r),ifct(n-r)));
}

int main(){
    ll n,a,b,c,d,f;
    cin>>n>>a>>b>>c>>d;
    ll dp[1010][1010]={};
    fct();
    ifct();
    
    dp[b+1][n]=1;
    for(ll i=b;i>=a;i--){
        //cout << i << endl;
        fr(j,n+1){
            dp[i][j]=ad(dp[i][j],dp[i+1][j]);
            f=1;
            Fr(k,c-1) f=mlt(f,comb(j+k*i,i));
            for(ll k=c;k<=d;k++){
                if(j+i*k>n) break;
                f=mlt(f,comb(j+k*i,i));
                dp[i][j]=ad(dp[i][j],mlt(dp[i+1][j+i*k],mlt(f,ifct(k))));
            }
        }
    }
    /*for(int i=2;i<4;i++){
        fr(j,8) cout<<dp[i][j]<<" ";
        cout<<endl;
    }*/
    cout<<dp[a][0]<<endl;
}


Compiler output:
a.cc: In function 'll fct()':
a.cc:42:26: error: expected ';' before ')' token
   42 |     for (int i=0;i<200008){
      |                          ^
      |                          ;
a.cc:45:1: warning: no return statement in function returning non-void [-Wreturn-type]
   45 | }
      | ^
a.cc: In function 'll ifct(ll)':
a.cc:51:46: error: invalid conversion from 'll*' {aka 'long long int*'} to 'll' {aka 'long long int'} [-fpermissive]
   51 |     for (int i=200009;i>=1;--i) ifc[i-1]=mlt(ifc, i);
      |                                              ^~~
      |                                              |
      |                                              ll* {aka long long int*}
a.cc:18:11: note:   initializing argument 1 of 'll mlt(ll, ll)'
   18 | ll mlt(ll x,ll y=1){
      |        ~~~^
a.cc:52:1: warning: no return statement in function returning non-void [-Wreturn-type]
   52 | }
      | ^
a.cc: In function 'll comb(ll, ll)':
a.cc:56:19: error: too many arguments to function 'll fct()'
   56 |     return mlt(fct(n),mlt(ifct(r),ifct(n-r)));
      |                ~~~^~~
a.cc:40:4: note: declared here
   40 | ll fct(){
      |    ^~~
a.cc: In function 'int main()':
a.cc:64:9: error: too few arguments to function 'll ifct(ll)'
   64 |     ifct();
      |     ~~~~^~
a.cc:49:4: note: declared here
   49 | ll ifct(ll x){
      |    ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
const ll MOD=1e9+7;

ll fct[20010];
ll ifct[20010];

ll MULT(int x, int y){
  return (x*y)%MOD;
}

ll POW(int x, int n){
  ll v=1;
  while(n>1){
    if(n%2==1)v=MULT(v, x);
    x=MULT(x,x);
    n/=2;
  }
  return v;
}

ll INV(int x){
  return POW(x, MOD-2);
}

void FCT(){
  fct[0]=1;
  for (int i=0;i<20010;++i) fct[i+1]=MULT(fct[i],i+1);
}

void INV_FCT(){
  ifct[20010-1]=INV(fct[20010-1]);
  for (int i=20010-1;i>=1;--i) ifct[i-1]=ifct[i]*i;
}

ll comb(int n, int k){
  return MULT(fct[n], MULT(ifct[k], ifct[n-k]);
}

int main(){
  int N, A, B, C, D;cin>>N>>A>>B>>C>>D;
  ll dp[1010][1010];memset(dp, 0, sizeof(dp));
  FCT;INV_FCT;

  dp[A-1][0]=1;
  for(ll i=A;i<=B;++i){
      for (int j=0;j<N+1;++j){
          (dp[i][j]+=dp[i-1][j])%=MOD;
          f=1;
          if(C!=1){
            for (int k=0;k<C-1;++k) f=MULT(f,comb(j-k*i,i));
          }
          for(ll k=C;k<=D;++k){
              if(j+i*k>N) break;
              f=MULT(f,comb(j+k*i,i));
              (dp[i][j]+=MULT(dp[i-1][j-i*k],MULT(f,ifct(k))))%=MOD;
          }
      }
  }
  
  cout<<dp[B][N]<<endl;
}

Compiler output:
a.cc: In function 'll comb(int, int)':
a.cc:41:47: error: expected ')' before ';' token
   41 |   return MULT(fct[n], MULT(ifct[k], ifct[n-k]);
      |              ~                                ^
      |                                               )
a.cc: In function 'int main()':
a.cc:53:11: error: 'f' was not declared in this scope
   53 |           f=1;
      |           ^
a.cc:60:57: error: 'ifct' cannot be used as a function
   60 |               (dp[i][j]+=MULT(dp[i-1][j-i*k],MULT(f,ifct(k))))%=MOD;
      |                                                     ~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
const ll MOD=1000000007;

ll fact[1001];
ll dp[1001][1001];

int extgcd(int a, int b, int& x, int& y){
  int d=a;
  if(b!=0){
    d=extgcd(b, a/b, x, y);
    y-=a/b*x;
  }else{
    x=1;y=0;
  }
  return d;
}

int mod_inverse(int a, int p){
  int x, y;
  int d=extgcd(a, p, x,y);
  return (int)(m+x%m)%m;
}

ll mod_fact(int n, int p, int& e){
  e=0;
  if (n==0) return 1;

  ll res=mod_fact(n/p, p, e);
  e+=n/p;

  if((n/p)%2!=0)return res*(p-fact[n%p])%p;
  return res*fact[n%p]%p;
}


ll mod_comb(int n, int k, int p){
  if(n<0 || k<0 || n<k) return 0;
  int e1, e2, e3;
  ll a1=mod_fact(n, p, e1), a2=mod_fact(k, p, e2), a3=mod_fact(n-k, p, e3);
  if(e1>e2+e3) return 0;
  return a1*mod_inverse(a2*a3%p, p)%p;
}

ll mod_d(int i, int j, int k, int p){
  if(k==0) return 1;
  return (mod_d(i, j, k-1, p)*mod_comb(i-(k-1)*j, j, p)/k)%p;
}

int main(){
  int N, A, B, C, D;cin>>N>>A>>B>>C>>D;
  memset(dp, 0, sizeof(dp));
  dp[0][A]=1;

  for (int i=0;i<=N;++i){
    for (int j=A;j<=B;++j){
      dp[i][j]=dp[i][j-1];
      int D_=min(D, i/j);
      for (int k=C;k<=D_;++k){
        int e;
        dp[i][j]+=dp[i-k*j][j-1]*mod_d(i, j, k, p);
      }
    }
  }

  cout << dp[N][B] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int mod_inverse(int, int)':
a.cc:25:16: error: 'm' was not declared in this scope
   25 |   return (int)(m+x%m)%m;
      |                ^
a.cc: In function 'int main()':
a.cc:64:49: error: 'p' was not declared in this scope
   64 |         dp[i][j]+=dp[i-k*j][j-1]*mod_d(i, j, k, p);
      |                                                 ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <map>

using ll = long long;
using namespace std;
constexpr ll inf = 1e15;

#define MAX_N 1000

constexpr int MAX = 10000;
constexpr int MOD = 1e9+7;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

// dp[i][j] := 最大のグループ人数がj人であるとき、i人をグループ分けする場合の数
ll dp[MAX_N+1][MAX_N+1] = {0};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int N, A, B, C, D;
    cin>>N>>A>>B>>C>>D;

    for (int i = 0; i <= B; i++) dp[0][i] = 1;

    COMinit();
    
    for (int n = 1; n <= N; n++) {
        for (int i = A; i <= B; i++) {
            ll comb = 1;
            for (int j = 1; j < C; j++) comb = (((comb * COM(n - i * (j - 1), i)) % MOD) * inv[j]) % MOD;
            for (int j = C; j <= D; j++) {
                 ll F = i * j;
                 comb = (((comb * COM(n - i * (j - 1), i)) % MOD) * inv[j]) % MOD;
                 if (n - F >= 0) dp[n][i] += dp[n - F][i - 1] * comb % MOD;
            }
        }
    }

    ll ans = 0;
    for (int i = A; i <= B; i++) ans = (ans + dp[N][i]) % MOD/
    cout<<ans<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:62: error: no match for 'operator/' (operand types are 'll' {aka 'long long int'} and 'std::ostream' {aka 'std::basic_ostream<char>'})
   65 |     for (int i = A; i <= B; i++) ans = (ans + dp[N][i]) % MOD/
      |                                        ~~~~~~~~~~~~~~~~~~~~~~^
      |                                                         |
      |                                                         ll {aka long long int}
   66 |     cout<<ans<<endl;
      |     ~~~~                                                      
      |     |
      |     std::ostream {aka std::basic_ostream<char>}
a.cc:65:62: note: candidate: 'operator/(ll {aka long long int}, int)' (built-in)
   65 |     for (int i = A; i <= B; i++) ans = (ans + dp[N][i]) % MOD/
      |                                        ~~~~~~~~~~~~~~~~~~~~~~^
   66 |     cout<<ans<<endl;
      |     ~~~~                                                      
a.cc:65:62: note:   no known conversion for argument 2 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
Language: C++

#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <limits>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

const ll INF = 1000000007;
const int MAX = 210000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int pr[100010];
void uini(int n) {
	for (size_t i = 0; i <= n; i++)
	{
		pr[i] = i;
	}
}

int parent(int x) {
	if (x == pr[x]) return x;
	return pr[x] = parent(pr[x]);
}

bool unit(int x, int y) {
	int px = parent(x);
	int py = parent(y);

	if (px == py) return false;
	if (px < py) {
		pr[py] = px;
	}
	else {
		pr[px] = py;
	}
	return true;
}
ll ar[40];
bool use[40];
ll table[1001][1001];
ll n, a, b, c, d;
ll memo[1001][1001];
ll rec(int v, int rem) {

	if (rem == 0) return 1;
	if (v > b) return 0;
	ll & res = memo[v][rem];

	if (~res) return res;
	res = rec(v + 1, rem);
	res %= INF;
	ll vr = 1;
	ll pt = 1;
	for (ll i = 1; i < c; i++)
	{
		vr *= table[rem - (v * (i - 1))][v];
		vr %= INF;
		vr *= inv[i];
		vr %= INF;

	}

	for (ll i = c; i <= d; i++)
	{
		if (v * i > rem) break;
		vr *= table[rem - (v * (i - 1))][v];
		vr %= INF;

		vr *= inv[i];

		vr %= INF;
		res += (vr  * rec(v + 1, rem - v * i)) % INF;
		res %= INF;
	}

	return res;
}
void solv() {

	cin >> n;
	cin >> a >> b;
	cin >> c >> d;
	table[0][0] = 1;
	for (size_t i = 1; i <= n; i++)
	{
		table[i][0] = 1;
		for (size_t j = 1; j <= n; j++)
		{
			table[i][j] = table[i - 1][j - 1] + table[i - 1][j];
			table[i][j] %= INF;
		}
	}

	memset(memo, -1, sizeof(memo));
	cout << rec(a, n);
}




int main() {
	COMinit();
	solv();

	return 0;
}


Compiler output:
a.cc:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
a.cc: In function 'void solv()':
a.cc:124:9: error: 'memset' was not declared in this scope
  124 |         memset(memo, -1, sizeof(memo));
      |         ^~~~~~
a.cc:19:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   18 | #include <iomanip>
  +++ |+#include <cstring>
   19 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF 1e18

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

const ll MOD = 1e9 + 7;

ll fastPow(ll x, ll n)
{
    if (n == 0)
        return 1;
    if (n % 2 == 0)
        return fastPow(x * x % MOD, n / 2);
    else
        return x * fastPow(x, n - 1) % MOD;
}

ll fac[11234];
void combInit(int mx)
{
    fac[0] = 0;
    fac[1] = 1;
    for (int i = 2; i <= mx; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
    }
}

ll modDiv(ll a, ll b)
{
    return a * fastPow(b, MOD - 2) % MOD;
}

int main()
{
    combInit(11234);

    ll perm[101][101];

    for (int i = 1; i <= 100; i++)
    {
        perm[i][1] = i;
        for (int j = 2; j <= 100; j++)
        {
            perm[i][j] = perm[i][j - 1] * (i - j + 1);
            perm[i][j] %= MOD;
        }
    }

    int n, a, b, c, d;

    cin >> n >> a >> b >> c >> d;

    ll dp[101][101];

    memset(dp, 0, sizeof(dp));

    for (int i = 0; i <= n; i++)
        dp[0][i] = 1;

    for (int i = 1; i <= n; i++)
    {
        for (int j = a; j <= b; j++)
        {
            dp[i][j] += dp[i][j - 1];
            for (int k = c; k <= d; k++)
            {
                if (i - j * k < 0)
                    break;
                dp[i][j] += dp[i - j * k][j - 1] * modDiv(perm[n - i + j * k][j * k], fastPow(fac[j], k) * fac[k]);
                dp[i][j] %= MOD;
            }
        }
    }

    ll res = 0;

    cout << dp[n][b] << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:5: error: 'memset' was not declared in this scope
   72 |     memset(dp, 0, sizeof(dp));
      |     ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <numeric>
  +++ |+#include <cstring>
    9 |
Language: C++

#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <cassert>
#include <vector>
//#include <array>
//#include <set>
//#include <map>
//#include <unordered_set>
//#include <unordered_map>
//#include <stack>
//#include <queue>
using ll = long long;
using namespace std;

#include "Modulo.h"
#define MOD 1000000007
unsigned int mod;
std::vector<unsigned int> fact_mod;
std::vector<unsigned int> rev_fact_mod;

using namespace std;

template<typename Tint>
Tint gcd(Tint a, Tint b) {
	// O(log max(a,b))
	return b != 0 ? gcd(b, a % b) : a;
}

template<typename Tint>
Tint lcm(Tint a, Tint b) {
	return a / gcd(a, b) * b;
}

// a x + b y = gcd(a, b)
template<typename Tint>
Tint extgcd(Tint a, Tint b, Tint &x, Tint &y) {
	// O(log max(a,b))
	Tint g = a; x = 1; y = 0;
	if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x;
	return g;
}

void set_mod(const int m) {
	mod = m;
}

template<typename Tint>
Tint inv_mod(Tint a) {
	Tint x, y;
	if (extgcd(a, mod, x, y) == 1)
		return (x + mod) % mod;
	else // unsolvable
		return 0;
}


unsigned int pow_mod(const unsigned long long x, const unsigned int k) { //x^k (mod mod) 
	if (k == 0)     return 1;
	if (k % 2 == 0) return pow_mod(x*x % mod, k / 2);
	else            return x * pow_mod(x, k - 1) % mod;
}

std::vector<unsigned int> set_fact_mod(unsigned int n) {
	fact_mod = vector<unsigned int>(n + 1);
	fact_mod[0] = 1;
	for (unsigned int i = 1; i <= n; i++)
	{
		fact_mod[i] = (long long)fact_mod[i - 1] * i % mod;
	}
	return fact_mod;
}

std::vector<unsigned int> set_rev_fact_mod(unsigned int n) {
	rev_fact_mod = vector<unsigned int>(n + 1);
	rev_fact_mod[n] = pow_mod(fact_mod[n], mod - 2);
	for (int i = n - 1; i >= 0; i--)
	{
		rev_fact_mod[i] = (long long)rev_fact_mod[i + 1] * (i + 1) % mod;
	}
	return rev_fact_mod;
}
int main() {
	unsigned int n, a, b, c, d;
	cin >> n >> a >> b >> c >> d;

	set_mod(MOD);
	set_fact_mod(n);
	set_rev_fact_mod(n);

	vector<unsigned int>dp(n + 1, 0);
	dp[0] = 1;
	for (unsigned int tmpb = a; tmpb <= b; tmpb++)
	{
		for (unsigned int tmpn = n; tmpn >= 1; tmpn--)
		{
			unsigned int sum_tmpb_tmpn = 0;
			for (unsigned int tmpk = c; tmpk <= min(tmpn / tmpb, d); tmpk++)
			{
				unsigned int tmprest = tmpn - tmpb * tmpk;
				ll cal;
				ll comb_tmpb = fact_mod[tmpn];
				comb_tmpb *= pow_mod(rev_fact_mod[tmpb], tmpk);
				comb_tmpb %= MOD;
				comb_tmpb *= rev_fact_mod[tmprest];
				comb_tmpb %= MOD;
				comb_tmpb *= rev_fact_mod[tmpk];
				comb_tmpb %= MOD;
				cal = dp[tmprest] * comb_tmpb;
				cal %= MOD;
				cal += sum_tmpb_tmpn;
				cal %= MOD;
				sum_tmpb_tmpn = cal;
			}
			dp[tmpn] = (dp[tmpn] + sum_tmpb_tmpn) % MOD;
		}
	}

	cout << dp[n] << endl;

	return 0;
}

Compiler output:
a.cc:17:10: fatal error: Modulo.h: No such file or directory
   17 | #include "Modulo.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<map>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

const ll mod = 1000000007;
ll fact[1500];
ll invfact[1500];

inline ll take_mod(ll a){
    return (a % mod + mod) % mod;
}

inline ll add(ll a, ll b){
    return take_mod(a+b);
}

inline ll sub(ll a, ll b){
    return take_mod(a-b);
}


inline ll mul(ll a, ll b){
    a = take_mod(a);
    b = take_mod(b);
    if (b == 0) return 0;
    ll res = mul(add(a, a), b >> 1);
    if(b & 1) res = add(res, a);
    return res;
}

inline ll pow(ll x, ll n){
    ll res = 1LL;
    while(n > 0){
        if(n & 1) res = mul(res, x);
        x = mul(x, x);
        n >>= 1;
    }
    return res;
}

ll mod_inv(ll x){
    return pow(x, mod-2);
}

// nは上限
void make_fact(ll n){
    fact[0] = 1;
    ll res = 1;
    for(int i = 1; i <= n; i++){
        fact[i] = res;
        res = mul(res, i+1);
    }
}

// nは上限
void make_invfact(ll n){
    invfact[0] = 1;
    invfact[n] = mod_inv(fact[n]);
    for(int i = n-1; i >= 1; i--){
        invfact[i] = mul(invfact[i + 1], i + 1);
    }
}


ll comb(ll n, ll k){
    return mul(mul(fact[n], invfact[n-k]), invfact[k]);
}

ll dp[1010][1010];

ll f()

int main(){
  int N, A, B, C, D;
  cin >> N >> A >> B >> C >> D;
  make_fact(N+10);
  make_invfact(N+10);

  for(int i = 0; i < 1010; i++){
    for(int j = 0; j < 1010; j++){
      dp[i][j] = 0;
    }
  }
  dp[0][A-1] = 1;

  for(int i = 0; i <= N; i++){
    for(int j = A; j <= B; j++){
      ll c = 1LL;
      dp[i][j] = add(dp[i][j], dp[i][j-1]);
      for(int k = 1; k <= min((N-i)/j, D); k++){
        c = mul(c, comb(N-i-j*(k-1), j));
        if(k < C) continue;

        ll x = mul(dp[i][j-1], mul(c, invfact[k]));
        dp[i+j*k][j] = add(dp[i+j*k][j], x);
      }
    }
  }

  cout << dp[N][B] << endl;

  return 0;
}


Compiler output:
a.cc:77:1: error: expected initializer before 'int'
   77 | int main(){
      | ^~~
Language: C++

#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>

using namespace std;

#define mod 1000000007

int a, b, c, d;
long long int fact[1001];
long long int comb[1001][1001];
long long int powrev[1001];
vector<vector<long long int> > result(1001, vector<long long int>(1001, -1));
// result[i][j] : i人でグループを作る。最大のグループの人数がj人のとき、グループ分けが何通りあるか

long long int getpow(long long int n, long long int k)
{
	if(k == 0) return 1;
	long long int tmp = getpow(n, k / 2);
	if(k % 2 == 0) return (tmp * tmp) % mod;
	else return (((tmp * tmp) % mod) * n) % mod;
}
long long int solve(int n, int k)
{
	if(result[n][k] >= 0) return result[n][k];
	if(n == 0) return result[n][k] = 1;
	if(k < a) return result[n][k] = 0;
	result[n][k] = solve(n, k - 1);
	long long int tmp = 1;
	for(int i = 1; i <= c - 1; i++){
		if((i - 1) * k > n) return;
		tmp *= (comb[n - (i - 1) * k][k] * powrev[i]) % mod;
		tmp %= mod;
	}
	for(int i = c; i <= d; i++){
		if(k * i > n) break;
		tmp *= (comb[n - (i - 1) * k][k] * powrev[i]) % mod;
		tmp %= mod;
		result[n][k] += (tmp * solve(n - k * i, k - 1)) % mod;
		result[n][k] %= mod;
	}
	// cout << n << " " << k << " " << result[n][k] << endl;
	return result[n][k];
}



int main()
{
	int n;
	cin >> n >> a >> b >> c >> d;
	comb[0][0] = 1;
	comb[1][0] = 1;
	comb[1][1] = 1;
	fact[0] = 1;
	fact[1] = 1;
	powrev[0] = 1;
	powrev[1] = 1;
	for(int i = 2; i <= n; i++){
		fact[i] = (fact[i - 1] * i) % mod;
		powrev[i] = getpow(i, mod - 2);
		for(int j = 0; j <= i; j++){
			comb[i][j] = (comb[i - 1][j - 1] + comb[i - 1][j]) % mod;
		}
	}
	cout << solve(n, b) << endl;
}

Compiler output:
a.cc: In function 'long long int solve(int, int)':
a.cc:46:37: error: return-statement with no value, in function returning 'long long int' [-fpermissive]
   46 |                 if((i - 1) * k > n) return;
      |                                     ^~~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;
ll power(const ll p,const int n)
{
  if(n==0){return 1;}
  if(n%2==1){power(p,n-1)*p%MOD;}
  else{const ll pp =power(p,n/2);
  return pp*pp%MOD;}
}
  
int main()
{
  int N,A,B,C,D;
  cin>>N>>A>>B>>C>>D;
  vector<ll> fact(N+1,1);
  vector<ll> inv(N+1,1);
  vector<ll> invfact(N+1,1);
  for(int i =2;i<=N;i++){
    fact[i]=fact[i-1]*i%MOD;
    inv[i]=power(i,MOD-2);
    invfact[i]=invfact[i-1]*inv[i]%MOD;
  }
  auto get =[&](const int i,const int l){
    return fact[i]*invfact[i-l]%MOD;
  };
  vector<ll> dp(N+1,0)
  dp[0]=1;
  for(int i = A; i <= B; i++){
    auto tmp = dp;
    for(int j = 0; j <=N; j++){
      if(dp[j] == 0){continue;}
      ll mul=1;
      ll di=1;
      for(int k = C;k <= D; k++){
        const ll rest =N-j-k*i;
        if(rest<0){break;}
        (mul*=get(rest,i))%=MOD;
        (di*=inv[k-C+1])%=MOD;
        (tmp[j+k*i]+=mul*di%MOD)%=MOD;
      }
    }
    dp=tmp;
  }
  cout << dp[N]<< endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:3: error: expected ',' or ';' before 'dp'
   30 |   dp[0]=1;
      |   ^~
a.cc: In function 'll power(ll, int)':
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^
Language: C++

#include <bits/stdc++.h>

#define INF 1 << 29

typedef long long int ll;
using namespace std;
#define REP(i,n) for(ll i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(ll i=(k);i<(int)(n);i++)

ll n,a,b,c,d;
ll mod = 1e9 + 7;
ll fac[1005];
ll invf[1005];
ll dp[1005][1005];

ll f(ll a,ll x){//a^x
  ll res = 1;
  while(x > 0){
    if(x&1) res = res * a % mod;
    a = a * a % mod;
    x >>= 1;
  }
  return res;
}

ll inv(ll x){
  return f(x,mod-2);
}

ll P(ll n, ll r){
  return fac[n] * invf[n-r] % mod;
}

int main(){
  cin >> n>>a>>b>>c>>d;
  fac[0] = 1;
  invf[0] = 1;
  FOR(i,1,n+1){
    fac[i] = i * fac[i-1] % mod;
    invf[i] = inv(fac[i]);
  }

  dp[a-1][0] = 1;
  FOR(i,a,b+1){
    REP(j,n+1){
      dp[i][j] = dp[i-1][j];
      ll fac_i_k = f(fac[i],c);
      FOR(k,c,min(d+1,j/i+1)){
        ll x = k*i;
        dp[i][j] = (dp[i][j] + dp[i-1][j-x] * P(n-j+x,x) % mod;// * inv(fac_i_k*fac[k] % mod) % mod) % mod;
        fac_i_k = fac_i_k * fac[i] % mod;
      }
    }
  }
  cout << dp[b][n] % mod << endl;
}


/*
ll n,a,b,c,d;
ll C[1010][1010] = {{0}};
ll ans = 0;
ll mod = 1e9 + 7;
ll dp[1010][1010] ={{0}};
ll fact[1010];
void gen_C(){
  C[1][0] = 1;
  C[1][1] = 1;
  FOR(i,2,1010){
    C[i][0] = 1;
    C[i][i] = 1;
    FOR(j,2,i){
      C[i][j] = C[i-1][j-1]+C[i-1][j];
      C[i][j] %= mod;
    }
  }
}

void gen_fact_mod(){
  fact[0] = 1;
  fact[1] = 1;
  FOR(i,2,1010){
    ll now = 1;
    ll ans = 1;
    ll p = mod -1;
    while(p>0){
      now *= now;
      now %= mod;
      if(p%2==1){
        ans *= now;
        ans %= mod;
      }
      p/=2;
    }
    fact[i] = (fact[i-1]*ans)%mod;
  }
}
dp[k][n] n人をk人以下のグループに分ける
dp[1][1] = 1;
dp[i][j] = j人をi人以下のグループに分ける人数
= dp[i-1][j-i*k] * f(i,j,k)
f(i,j,k) j人中i人グループがk個あった時の通り数
j-i*k人は使われているのでn-(j-i*k)=n-j+i*k人中何通りグループ分けが存在するかを調べればいい
f(i,j,k) = (n-j+i*k)P(i*k)/(i!)^k/k!
= Pi(1<=l<=k) (n-j+i*l)C(i)/k!


int main(){
  cin >>n>>a>>b>>c>>d;
  gen_C();
  gen_fact_mod();
  FOR(i,c,d+1){//a人の時のグループの分け方
    ll tmp = 1;
    if(a*i>n) break;
    REP(j,i){
      tmp *= C[n-i*a][a];
      tmp %= mod;
    }
    tmp %= mod;
    dp[a][a*i] = (tmp * fact[i])%mod;
  }
  FOR(i,a+1,b+1){//i人以下のグループで分ける時
    REP(j,n){
      dp[i][j] = dp[i-1][j];
      ll tmp =1;
      ll ans = 0;
      if(n-j+i*c<0||n-j+i*c>n) break;
      REP(k,c){
        tmp *= C[n-j+i*k][i];
        tmp %= mod;
      }
      tmp %= mod;
      tmp = (tmp * fact[c])%mod;
      ans += (tmp * dp[i-1][j-i*c])%mod;
      FOR(k,c+1,min(i/j,d)){
        tmp *= k-1;
        tmp %= mod;
        tmp += C[n-j+i*k][i];
        tmp %= mod;
        tmp = (tmp * fact[k]) %mod;
        ans += (tmp* dp[i-1][j-i*k]) % mod;
      }
    }
  }
  cout << dp[n][n]<<endl;
}
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:50:63: error: expected ')' before ';' token
   50 |         dp[i][j] = (dp[i][j] + dp[i-1][j-x] * P(n-j+x,x) % mod;// * inv(fac_i_k*fac[k] % mod) % mod) % mod;
      |                    ~                                          ^
      |                                                               )
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vt = vector<T>;
template<class T> using vvt = vector<vt<T>>;
template<class T> using ttt = tuple<T,T>;
using tii = tuple<int,int>;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define DIV int(1e9+7)
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-8;
const double PI = M_PI;  
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}

/* Coding Space*/
class FermatCombination{
public:
  vector<ll> factrial; // 階乗
  vector<ll> inverse; // 逆元
  FermatCombination(int size){
    factrial.resize(size+1);
    inverse.resize(size+1);
    factrial[0] = 1;
    inverse[0] = 1;
    for(int i = 1; i < size+1; i++){
      factrial[i] = factrial[i-1] * i % DIV;
      inverse[i] = pow(factrial[i],DIV-2,DIV);
    }
  }
  ll combination(int n, int k){
    if(n < k) return 0; 
    return factrial[n]* inverse[k] % DIV * inverse[n - k] % DIV;
  }
  ll permutation(int n, int k){
    if(n < k) return 0; 
    return factrial[n] * inverse[n-k] % DIV;
  }
  ll multi_choose(int n, int k){
    if(n == 0 && k == 0) return 1;
    else return combination(n+k-1,k);
  }
};

ll dp[1010][1010] = {}; // i : members of group, j : number of using.

int main(){
  int n,a,b,c,d; cin >> n >> a >> b >> c >> d;
  FermatCombination fc(n+1);
  rep(i,1010) dp[i][0] = 1;
  
  for(int i = a; i <= b; i++)
    for(int j = 0; j <= n; j++){
      if(dp[i][j] == 0) continue;
      if(j != 0){
        dp[i+1][j] += dp[i][j];
        dp[i][j] %= DIV;
      }
      ll tmp = 1;
      for(int k = 1; k <= d; k++){
        if(n-j-i*k- < 0) break;
        tmp *= fc.combination(n-j-i*(k-1), i );
        tmp %= DIV;
        tmp *= fc.inverse[k];
        tmp %= DIV;
        if(k >= c && k <= d){
          dp[i+1][j+i*k] += 1LL * dp[i][j] * tmp;
          dp[i+1][j+i*k] %= DIV;
        }
      }
    }
  cout << dp[b+1][n] % DIV << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:21: error: expected primary-expression before '<' token
   70 |         if(n-j-i*k- < 0) break;
      |                     ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define LL long long

using namespace std;

struct Culc {

    vector<long long> factorial;
    long long p;

    //階乗
    Culc(long long N, long long p_) {
        long long ans = 1;
        p=p_;
        factorial.push_back(ans);
        for (long long i = 1; i <= N; i++) {
            ans = ans * i % p;
            factorial.push_back(ans);
        }
    }

    long long extgcd(long long a, long long b, long long &x, long long &y) {
        long long g = a;
        if (b) {
            g = extgcd(b, a % b, y, x);
            y -= x * (a / b);
        } else {
            x = 1;
            y = 0;
        }
        return g;
    }

    long long gcd(long long a, long long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    long long lcm(long long a, long long b) {
        return a * b / gcd(a, b);
    }

    long long inverse(long long a, long long p) {
        long long x, y;
        extgcd(a, p, x, y);
        return ((x % p) + p) % p;
    }

//nCk mod p
//
    long long combination(long long n, long long k) {
        return factorial[n] * (inverse(factorial[k] * factorial[n - k] % p, p)) % p;
    }

};

int main(){

    int N,A,B,C,D;cin>>N>>A>>B>>C>>D;
    LL inf = 1e9+7;

    //dp[i][j]:i人をj人以下のグループで分けるときの組み合わせ
    //dp[i][j] = dp[i][j-1] + iCj * dp[i-j][j-1] + iCj*(i-j)Cj/2 * dp[i-2*j][j-1] + ...
    //=dp[i][j-1] + sigma(for k=C; k<=D&&kj<=i;k++) dp[i-kj][j-1]* (iCj*(i-j)Cj*...*(i-(k-1)j)Cj)/k!
    //k=0 or C<=k<=D
    LL dp[N+1][B+1];
    fill(dp[0],dp[N+1],0);
    REP(i,B+1)dp[0][i]=1;
    Culc culc(N+1,inf);

    REP(i,N+1){
        for(int j=A;j<=B;j++){
            LL sigma =0;
            LL comb=1;
            LL cnt=0;
            for(int k=C;k<=D&&k*j<=i;k++){
                cnt++;
                comb = (comb*culc.combination(i-j*(k-C),j))%inf;
                sigma += (((dp[i-k*j][j-1]*comb)%inf)*culc.inverse(culc.factorial[k],inf)%inf;
                sigma %=inf;
            }
            dp[i][j]=(dp[i][j-1]+sigma)%inf;
        }
    }

    cout<<dp[N][B]<<endl;


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:80:94: error: expected ')' before ';' token
   80 |                 sigma += (((dp[i-k*j][j-1]*comb)%inf)*culc.inverse(culc.factorial[k],inf)%inf;
      |                          ~                                                                   ^
      |                                                                                              )
Language: C++

#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define sz(a) ((int)(a).size())
#define rep(i, a, b) for(int (i) = (a); (i) < (b); (i)++)
#define dec(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define MAXN 1010
#define N 1010
#define LOGN 20
#define buli(x) (__builtin_popcountll(x))
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef long double ld;

inline void gn(long long&x){
	int sg=1;char c;while(((c=getchar())<'0'||c>'9')&&c!='-');c=='-'?(sg=-1,x=0):(x=c-'0');
	while((c=getchar())>='0'&&c<='9')x=x*10+c-'0';x*=sg;
}
inline void gn(int&x){long long t;gn(t);x=t;}
inline void gn(unsigned long long&x){long long t;gn(t);x=t;}
inline void gn(double&x){double t;scanf("%lf",&t);x=t;}
inline void gn(long double&x){double t;scanf("%lf",&t);x=t;}
inline void gs(char *s){scanf("%s",s);}
inline void gc(char &c){while((c=getchar())>126 || c<33);}
const int mod = 1e9+7;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
#define int long long
int a, b, c, d, n;
ll fat[N], ifat[N], mat[N][N];
int dp[N][N], dp2[N][N];
void pre(){
    rep(i,0,MAXN){
        mat[i][0]=mat[i][i]=1;
        rep(j,0,i){
            mat[i][j]=(mat[i-1][j]+mat[i-1][j-1])%mod;
        }
    }
}

ll comb(int x, int y){
    return mat[x][y];
}

ll solve2(int qt, int t){
    if(qt == 1) return 1;
    if(dp2[qt][t]!=-1)return dp2[qt][t];
    ll ans =0;
    ans = (solve2(qt-1,t)*comb(qt*t, t))%mod;
    ans*=ifat[qt];
    ans%=mod;
    return dp2[qt][t]=ans;
}

int solve(int p, int t){
    if(p == 0)return 1;
    if(t >b)return 0;
    if(dp[p][t]!=-1)return dp[p][t];
    ll ans=0;
    ans += solve(p,t+1);
    ans%=mod;
    for (int i = c; i <= d && i * t <= p; i++){
        ans += (solve(p - (i * t), t + 1) * ((comb(p, t * i) * solve2(i, t))%mod))%mod;
        ans %=mod;
    }
    return dp[p][t]=ans;
}

int main()
{
    fat[1]=1;
    rep(i,2,MAXN)fat[i]= (fat[i-1]*i)%mod;
    rep(i,1,MAXN)ifat[i]=powmod(fat[i],mod-2);
    gn(n); gn(a);gn(b);gn(c);gn(d); 
    pre();
    clr(dp, -1);
    clr(dp2, -1);
    printf("%d\n", solve(n, a));
    return 0;
}












































Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;
typedef pair<ll, ll> PL;
typedef pair<P, ll> PPL;

#define INF INT_MAX/3

#define MAX_N 1000

#define M 1000000007

ll fact[11111];

//// extended gcd
ll extgcd(ll a,ll b,ll& x,ll& y){
	ll d=a;
	if(b!=0){
		d=extgcd(b,a%b,y,x);
		y-=(a/b)*x;
	}else{
		x=1;y=0;
	}
	return d;
}

//// mod inverse
ll mod_inverse(ll a,ll m){
	ll x,y;
	extgcd(a,m,x,y);
	return (m+x%m)%m;
}

//// mod combination ex.( num of route (0,0)->(x,y)=mod_comb(x+y,x,M)
ll mod_comb(int n,int k,int p){
	if(n<0||k<0||n<k)return 0;
	return ((fact[n]*mod_inverse(fact[k],p))%p)*mod_inverse(fact[n-k],p)%p;
}

ll dp[1111][1111];
ll a,b,c,d;

ll dfs(ll g,ll rest){
	if(rest==0)return 1;
	else if(rest<g||g>b)return 0;
	else{
		if(mem[g][rest]!=-1)return mem[g][rest];
		ll res=0;
		res=(res+dfs(g+1,rest))%M;
		ll ncomb=1,nrest=rest;
		repl(i,c,d+1){
			if(g*i>rest)break;
			ncomb=ncomb*mod_comb(nrest,g,M)%M;
			nrest-=g;
			res=(res+((dfs(g+1,rest-g*i)*ncomb)%M)*mod_inverse(fact[i],M))%M;
		}
		return mem[g][rest]=res%M;
	}
}

int main(){
	cin.sync_with_stdio(false);
	fact[0]=fact[1]=1;
	repl(i,1,11111)fact[i+1]=(fact[i]*(i+1))%M;
	ll n;
	memset(mem,-1,sizeof(mem));
	cin>>n>>a>>b>>c>>d;
	cout<<dfs(a,n)<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'll dfs(ll, ll)':
a.cc:66:20: error: 'mem' was not declared in this scope
   66 |                 if(mem[g][rest]!=-1)return mem[g][rest];
      |                    ^~~
a.cc:76:24: error: 'mem' was not declared in this scope
   76 |                 return mem[g][rest]=res%M;
      |                        ^~~
a.cc: In function 'int main()':
a.cc:85:16: error: 'mem' was not declared in this scope
   85 |         memset(mem,-1,sizeof(mem));
      |                ^~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

class combination
{
public:

	//Nの最大値がわかれば代入する
	combination( long long int combinationThreshold = 1e7 ) {
		(*this).combinationThreshold = combinationThreshold + 2;
	}

	//a^p % mod
	long long int powmod( long long int A, long long int P, long long int M = LLONG_MAX ) {
		long long int ans = 1;
		long long int mul = A;
		for( ; P > 0; P >>= 1, mul = (mul*mul) % M ) {
			if( (P & 1) == 1 ) ans = (ans*mul) % M;
		}
		return ans;
	}

	//nCk mod m
	long long int cb( long long int N, long long int K, long long int M = LLONG_MAX ) {
		if( N < combinationThreshold ) {// 事前計算O(N)、答えるのはO(1)
			if( inv.size() == 0 ) {
				inv = vector<long long int>( combinationThreshold );
				inv[1] = 1;
				for( long long int i = 2; i < combinationThreshold; i++ ) {
					inv[i] = M - (M / i)*inv[M%i] % M;
				}
				fact = vector<long long int>( combinationThreshold );
				fact[0] = 1;
				revFact = vector<long long int>
					( combinationThreshold );
				revFact[0] = 1;
				for( long long int i = 1; i < combinationThreshold; i++ ) {
					fact[i] = (fact[i - 1] * i) % M;
					revFact[i] = (revFact[i - 1] * inv[i]) % M;
				}
			}
			return (((fact[N] * revFact[K]) % M)*revFact[N - K]) % M;
		} else {
			return cbOnce( N, K, M );
		}
	}

	//一回だけなら最速 O(K + log(M))
	long long int cbOnce( long long int N, long long int K, long long int M = LLONG_MAX ) {
		if( K > N / 2 ) return cb( N, N - K, M );
		long long int ans = 1;
		long long int div = 1;
		for( long long int i = 0; i < K; i++ ) {
			ans *= N - i;
			ans %= M;
			div *= i + 1;
			div %= M;
		}
		ans *= powmod( div, M - 2, M );
		return ans%M;
	}

private:
	vector<vector<long long int>>C;//3000以下の答え
	vector<long long int>fact;//階乗
	vector<long long int>revFact;//階乗の逆元
	vector<long long int>inv;//mod pでの逆元

	long long int combinationThreshold;//Nの最大値がわかれば入れる。
};







combination cb;

map<pair<long long int, long long int>, long long int>memo;

long long int saiki( long long int N, long long int A, long long int B, long long int C, long long int D ) {
	long long int ret = 0;
	if( N == 0 ) {
		return 1;
	}
	if( N < A*C ) {
		return 0;
	}
	if( memo.count( make_pair( N, A ) ) != 0 ) {
		return memo[make_pair( N, A )];
	}
	for( long long int i = A; i <= B; i++ ) {
		for( long long int j = C; j <= D && j*i <= N; j++ ) {
			long long int memox = saiki( N - i*j, i + 1, B, C, D )*cb.cb( N, i*j, 1e9L + 7 );
			long long int xxx = 1;
			for( size_t k = 1; k <= j; k++ ) {
				xxx *= cb.cb( k*i, i, 1e9 + 7 );
				xxx %= (long long int)1e9 + 7;
				xxx *= cb.powmod( k, 1e9 + 5, 1e9 + 7 );
				xxx %= (long long int)1e9 + 7;

			}
			//cout << xxx << endl;
			memox *= xxx;
			ret += memox;
			ret %= (long long int)1e9L + 7;
		}
	}
	return memo[make_pair( N, A )] = ret;
}


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

N, M = gets.split.map(&:to_i)
as = [0] + gets.split.map(&:to_i) + [0]
(1...N).each do |i|
    as[i] += as[i-1]
end
bs = N.times.map{gets.split.map(&:to_i)}

ans = 0
N.times do |l|
    (l...N).each do |r|
        result = as[l] - as[r]
        M.times do |j|
            result += (l..r).map{|i| bs[i][j]}.max
        end
        ans = [ans, result].max
    end
end
puts ans

Compiler output:
a.cc:3:2: error: too many decimal points in number
    3 | (1...N).each do |i|
      |  ^~~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N, M = gets.split.map(&:to_i)
      | ^
a.cc:8:1: error: 'ans' does not name a type
    8 | ans = 0
      | ^~~
a.cc:13:47: error: expected unqualified-id before '.' token
   13 |             result += (l..r).map{|i| bs[i][j]}.max
      |                                               ^