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

//all possible//
#include<iostream>
using namespace std;
int a,b,c,n,i,j,k,l,m;
int main()
{
	deque <int> v;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a;
		
		v.push_front(a);
		reverse(v.begin(),v.end());
		
	}
	reverse(v.begin(),v.end());
	for(i=0;i<v.size();i++)
	{
		cout<<v[i]<<" ";	
	}

}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'deque' was not declared in this scope
    7 |         deque <int> v;
      |         ^~~~~
a.cc:3:1: note: 'std::deque' is defined in header '<deque>'; this is probably fixable by adding '#include <deque>'
    2 | #include<iostream>
  +++ |+#include <deque>
    3 | using namespace std;
a.cc:7:16: error: expected primary-expression before 'int'
    7 |         deque <int> v;
      |                ^~~
a.cc:13:17: error: 'v' was not declared in this scope
   13 |                 v.push_front(a);
      |                 ^
a.cc:14:17: error: 'reverse' was not declared in this scope
   14 |                 reverse(v.begin(),v.end());
      |                 ^~~~~~~
a.cc:17:17: error: 'v' was not declared in this scope
   17 |         reverse(v.begin(),v.end());
      |                 ^
a.cc:17:9: error: 'reverse' was not declared in this scope
   17 |         reverse(v.begin(),v.end());
      |         ^~~~~~~
Language: C++

/*
長さ n の数列 a1,…,an が与えられます。 空の数列 b に対して、以下の操作を n 回行うことを考えます。
i 回目には
数列の i 番目の要素 ai を b の末尾に追加する。
b を逆向きに並び替える。
この操作をしてできる数列 b を求めて下さい。
制約
1≤n≤2×10^5
0≤ai≤109
n,ai は整数である。
*/

#include<stdio.h>

int *returning(int input[10000],int n)
{
	int ret[10000];
	int i;
	for ( i = 0; i < n; i++)
	{
		ret[i] = input[n - i - 1];
	}
	return ret;
}

int main()
{
	int n, input[10000];
	scanf("%d", &n);
	int i;
	for ( i = 0; i < n; i++)
	{
		scanf("%d", &input[i]);
	}
	int ret[10000];
	for ( i = 0; i < n; i++)
	{
		ret[i] = input[i];
		ret = returning(ret, i);
	}
	for ( i = 0; i < n; i++)
	{
		printf("%d ", &ret[i]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int* returning(int*, int)':
a.cc:23:16: warning: address of local variable 'ret' returned [-Wreturn-local-addr]
   23 |         return ret;
      |                ^~~
a.cc:17:13: note: declared here
   17 |         int ret[10000];
      |             ^~~
a.cc: In function 'int main()':
a.cc:39:21: error: incompatible types in assignment of 'int*' to 'int [10000]'
   39 |                 ret = returning(ret, i);
      |                 ~~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main(){
  int n;
  vector<int> nums;
  vector<int> b;
  cin >> n;
  for(int i=0;i<n;i++){
    int tmp;
    cin >> tmp;
    nums.push_back(tmp);
  }

  for(int i=0;i<n;i++){
    b.push_back(nums[i]);
    reverse(b.begin(), b.end());
  }

  for(int i=0;i<n-1;i++)
    cout << b[i] << " ";
  cout << b[n-1] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'reverse' was not declared in this scope
   18 |     reverse(b.begin(), b.end());
      |     ^~~~~~~
Language: Java

for(int i=0;i<n;i++){
        System.out.print(queue.poll());
        System.out.print(" ");
      }

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
for(int i=0;i<n;i++){
^
Main.java:1: error: class, interface, enum, or record expected
for(int i=0;i<n;i++){
            ^
Main.java:1: error: class, interface, enum, or record expected
for(int i=0;i<n;i++){
                ^
Main.java:3: error: class, interface, enum, or record expected
        System.out.print(" ");
        ^
Main.java:4: error: class, interface, enum, or record expected
      }
      ^
5 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int ara[n+10];
for(int i=0;i<n;i++) cin>>ara[i];
bool flag=1;
for(int i=n-1;I>0;i-=2) {
if(flag){
cout<<ara[i];
flag=0;
}
else cout<<' ' <<ara[i];
}
flag=1;
for(int i=0;I<n;i+=2) {
if(flag){
cout<<ara[i];
flag=0;
}
else cout<<' ' <<ara[i];
}



}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'I' was not declared in this scope
   10 | for(int i=n-1;I>0;i-=2) {
      |               ^
a.cc:18:13: error: 'I' was not declared in this scope
   18 | for(int i=0;I<n;i+=2) {
      |             ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main(int argc, const char * argv[]) {
    long long n;
    
    long long x;
    vector<long long> a, b;
    
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x;
        a.push_back(x);
    }
    
    for (int i = 0; i < n; i++) {
        b.push_back(a[i]);
        reverse(b.begin(), b.end());
    }
    
    for (int i = 0; i < n; i++) {
        cout << b[i];
        if (i < n-1) {
            cout << ' ';
        }else{
            cout << endl;
        }
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:19:9: error: 'reverse' was not declared in this scope
   19 |         reverse(b.begin(), b.end());
      |         ^~~~~~~
Language: C++

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main() {
    int n,dis; cin>>n;
    vector<int> me(n+1,-1);
    int ad;
    rep(i,n+1){
        scanf("%d",&d);
        if(me[ad]>=0){
            dis=i-me[ad]+1; break;
        }
        else{
            me[ad]=i;
        }
    }
    vector<ll> v(n+2,0); v[1]=1;
    for(int i=2;i<=n+1;i++){
        v[i]=(-v[MOD%i]*(MOD/i))%MOD;
    }
    ll c=1,d=1;
    rep(i,n+1){
        c=((c*(n+1-i))%MOD)*v[i+1]%MOD;
        c=(c+MOD)%MOD;
        printf("%lld\n",(c-d+MOD)%MOD);
        d=((d*(n+1-dis-i))%MOD)*v[i+1]%MOD;
        d=(d+MOD)%MOD;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: 'd' was not declared in this scope
   22 |         scanf("%d",&d);
      |                     ^
Language: C++

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main() {
    int n,dis; cin>>n;
    vector<int> me(n+1,-1);
    int ad;
    rep(i,n+1){
        scanf("%d",&ad);
        if(me[ad]>=0){
            dis=i-me[ad]+1; break;
        }
        else{
            me[ad]=i;
        }
    }
    vector<ll> v(n+2,0); v[1]=1;
    for(int i=2;i<=n+1;i++){
        v[i]=(-v[MOD%i]*(MOD/i))%MOD;
    }
    ll c=1,d=1;
    rep(i,n+1){
        c=((c*(n+1-i))%MOD)*v[i+1]%MOD;
        c=(c+MOD)%MOD;
        print("%d",(c-d+MOD)%MOD);
        d=((d*(n+1-dis-i))%MOD)*v[i+1]%MOD;
        d=(d+MOD)%MOD;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:9: error: 'print' was not declared in this scope; did you mean 'rint'?
   38 |         print("%d",(c-d+MOD)%MOD);
      |         ^~~~~
      |         rint
Language: C++

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main() {
    int n,dis; cin>>n;
    vector<int> me(n+1,-1);
    int ad;
    rep(i,n+1){
        scanf("%d",&d);
        if(me[ad]>=0){
            dis=i-me[ad]+1; break;
        }
        else{
            me[ad]=i;
        }
    }
    vector<ll> v(n+2,0); v[1]=1;
    for(int i=2;i<=n+1;i++){
        v[i]=(-v[MOD%i]*(MOD/i))%MOD;
    }
    ll c=1,d=1;
    rep(i,n+1){
        c=((c*(n+1-i))%MOD)*v[i+1]%MOD;
        c=(c+MOD)%MOD;
        print("%d",(c-d+MOD)%MOD);
        d=((d*(n+1-dis-i))%MOD)*v[i+1]%MOD;
        d=(d+MOD)%MOD;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: 'd' was not declared in this scope
   22 |         scanf("%d",&d);
      |                     ^
a.cc:38:9: error: 'print' was not declared in this scope; did you mean 'rint'?
   38 |         print("%d",(c-d+MOD)%MOD);
      |         ^~~~~
      |         rint
Language: C++

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

// https://freestylewiki.xyz/fswiki/wiki.cgi?page=AtCoder+Beginner+Contest+066

ll mod = 1000000007;
ll factorial[100002];
ll mod_factorial[100002];

ll pow(ll factor, ll q) {
  if (q == 1) {
    return factor % mod;
  }
  if (q % 2 == 0) {
    ll sub = pow(factor, q / 2);
    return ((sub % mod) * (sub % mod)) % mod;
  } else {
    return ((factor % mod) * (pow(factor, q - 1) % mod)) % mod;
  }
}
void init() {
  for (ll i = 0; i <= 100001; i++) {
    if (i == 0 || i == 1) {
      factorial[i] = 1;
    } else {
      factorial[i] = ((i % mod) * (factorial[i - 1] % mod)) % mod;
    }
  }
  for (ll i = 0; i <= 100001; i++) {
    if (i == 0 || i == 1) {
      mod_factorial[i] = 1;
    } else {
      mod_factorial[i] = pow(factorial[i], mod -2 ) % mod;
    }
  }
}
ll C(ll n, ll k) {
  if (n < k) {
    return 0;
  }
  ll sub = ((factorial[n] % mod) * (mod_factorial[k] % mod)) % mod;
  return ((sub % mod) * (mod_factorial[n - k] % mod)) % mod;
}

int main() {
  ll N;
  cin >> N;

  vector<ll> list(N);
  map<ll, int> m;
  ll v;
  for (ll i = 0; i < N + 1; i++) {
    cin >> list[i];
    m[list[i]]++;
    if (m[list[i]] == 2) {
      v = list[i];
    }
  }

  ll fv = -1, sv = -1;
  for (ll i = 0; i < N + 1; i++) {
    if (list[i] == v && fv == -1) {
      fv = i;
    } else if (list[i] == v && sv == -1) {
      sv = i;
    }
  }

  init();
  for (ll i = 1; i <= N + 1; i++) {
    if (1 == 1) {
      cout << n << endl;
    } else {
      if (i == n + 1) {
        cout << 1 << endl;
      } else {
        cout << (C(N + 1, i) % mod + mod - C(fv + N - sv, i - 1) % mod) % mod << endl;
      }
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:15: error: 'n' was not declared in this scope
   74 |       cout << n << endl;
      |               ^
a.cc:76:16: error: 'n' was not declared in this scope
   76 |       if (i == n + 1) {
      |                ^
Language: C++

#include<iostream>
#include<vector>
#include<utility>
using namespace std;

const int MAX = 10000000;
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;
    }
}

// 二項係数計算
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;
}

int main(){
  // 前処理
  COMinit();
  int n;cin >> n;
  vector<int> a(n+1);for(int i=0;i<n+1;i++){cin >> a[i];a[i]-=1;}
  vector<bool> b(n,true);
  for(int i=0;i<n+1;i++){b[a[i]]=!b[a[i]];}
  pair<int,int> p=make_pair(-1,-1);
  for(int i=0;i<n+1;i++){
    if(b[a[i]]){
      if(p.first==-1){p.first=i;}
      else{p.second=i;break;}
    }
  }
  for(int i=1;i<=n+1;i++){
    //cout << (COM(n+1,i)-COM(n+1-(p.second-p.first+1),i-1))%MOD << endl;
    int c=COM(n+1,i)-COM(p.first+(n-p.second),i-1)
    while(c<0){
      c+=MOD;
    }
    cout << c%MOD << endl;

    //cout << COM(p.first+(n-1-p.second),i-1)%MOD << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:5: error: expected ',' or ';' before 'while'
   47 |     while(c<0){
      |     ^~~~~
Language: C++

#include<iostream>
#include<vector>
#include<utility>
using namespace std;

const int MAX = 10000000;
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;
    }
}

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

int main(){
  // 前処理
  COMinit();
  int n;cin >> n;
  vector<int> a(n+1);for(int i=0;i<n+1;i++){cin >> a[i];a[i]-=1;}
  vector<bool> b(n,true);
  for(int i=0;i<n+1;i++){b[a[i]]=!b[a[i]];}
  pair<int,int> p=make_pair(-1,-1);
  for(int i=0;i<n+1;i++){
    if(b[a[i]]){
      if(p.first==-1){p.first=i;}
      else{p.second=i;break;}
    }
  }
  for(int i=1;i<=n+1;i++){
    //cout << (COM(n+1,i)-COM(n+1-(p.second-p.first+1),i-1))%MOD << endl;
    cout << (COM(n+1,i)-COM(p.first+(n-p.second),i-1)) << endl;
    //cout << COM(p.first+(n-1-p.second),i-1)%MOD << endl;
  }
}


Compiler output:
a.cc:24:15: error: 'll' was not declared in this scope
   24 | long long COM(ll n, ll k){
      |               ^~
a.cc:24:21: error: 'll' was not declared in this scope
   24 | long long COM(ll n, ll k){
      |                     ^~
a.cc:24:25: error: expression list treated as compound expression in initializer [-fpermissive]
   24 | long long COM(ll n, ll k){
      |                         ^
a.cc: In function 'int main()':
a.cc:46:17: error: 'COM' cannot be used as a function
   46 |     cout << (COM(n+1,i)-COM(p.first+(n-p.second),i-1)) << endl;
      |              ~~~^~~~~~~
a.cc:46:28: error: 'COM' cannot be used as a function
   46 |     cout << (COM(n+1,i)-COM(p.first+(n-p.second),i-1)) << endl;
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define SIZE 300005
#define MOD 1000000007LL
#define EPS 1e-10
#define INF 1<<29
#define LLINF 1LL<<60
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
#define BIT(i,j) ((i)>>(j))&1
#define ALL(o) (o).begin(), (o).end()
#define ERASE(o) (o).erase(unique((o).begin(),(o).end()), (o).end())
#define SQ(x) ((x)*(x))
using namespace std;
typedef long long ll;
typedef pair<ll,ll> Pll;
typedef pair<int, int> Pii;
typedef pair<double, double> Pdd;
typedef complex<double> dcomplex;
template<typename T> inline void priv(vector<T>a){REP(i,a.size()){cerr<<a[i]<<((i==a.size()-1)?"\n":" ");}}
ll gcd(ll a,ll b){int c=max(a,b);int d=min(a,b);return c==0||d==0?c:gcd(c%d,d);}
ll lcm(ll a,ll b){return a==0||b==0?0:a*b/gcd(a,b);}
ll modpow(ll a, ll n){ll b=1;while (n>0){if(n&1)b=b*a%MOD;a=a*a%MOD;n>>=1;}return b;}

ll N;
ll fact[100010];
ll ifact[100010];

ll modcomb(ll n, ll k){
    if(k < 0 || k > n) return 0;
    ll ans = fact[n];
    ans = ans * ifact[k] % MOD;
    ans = ans * ifact[n-k] % MOD;
    return ans;
}

int main() {
    scanf("%llu", &N);
    vector<ll> cnt(N+1, -1);
    ll a, d1, d2, diff;
    REP(i, N) {
        scanf("%llu", &a);
        if(cnt[a] != -1) {
            d1 = min(cnt[a], ll(i));
            d2 = max(cnt[a], ll(i));
            diff = d2 - d1;
            break;
        }
        cnt[a] = i;
    }
    fact[0] = 1;
    ifact[0] = 1;
    FOR(i, 1, N+2) {
        fact[i] = fact[i-1] * i % MOD;
        ifact[i] = modpow(fact[i], MOD-2);
    }
    ll ans;
    printf("%lld\n", N);
    FOR(k, 2, N) {
        ans = modcomb(N+1, k);
        ans = (ans - modcomb(N-diff), k-1) + MOD) % MOD;
        printf("%llu\n", ans);
    }
    printf("1\n");
 	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:29: error: too few arguments to function 'll modcomb(ll, ll)'
   62 |         ans = (ans - modcomb(N-diff), k-1) + MOD) % MOD;
      |                      ~~~~~~~^~~~~~~~
a.cc:30:4: note: declared here
   30 | ll modcomb(ll n, ll k){
      |    ^~~~~~~
Language: C++

#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
#define REP(i, n) for(int i = 0; i < (n); ++i)
typedef long long ll;
const ll MOD = 1000000007;
using namespace std;

vector<int> fact_inv(100000, -1), fact(10001, -1);

ll pow(int a, int b) {
	if (!b) {
		return 1;
	}
	else if (b % 2 == 0) {
		ll d = pow(a, b/2);
		return (d * d)%MOD;
	}
	else {
		return (a*pow(a, b-1))%MOD;
	}
}

ll factional(int a){
    if(fact[a] != -1) return ll(fact[a]);
    ll ret = 1;
    REP(i, a) ret = ret * (i+1) % MOD;
    fact[a] = int(ret);
    return ret;
}

ll inv(int a){
    if(fact_inv[a] != -1) return ll(fact_inv[a]);
    fact_inv[a] = int(pow(a, int(MOD-2)));
    return ll(fact_inv[a]);
}

ll comb(int a, int b){
    if(a < b) return 0;
    if(a < 0 || b < 0) reuturn 0;
    ll ret = factional(a);
    REP(i, b) ret = ret * inv(i+1) % MOD;
    REP(i, a-b) ret = ret * inv(i+1) % MOD;
    return ret;
}

int main(){
    int n; cin >> n;
    int dif;
    vector<int> idx(n, 0);
    REP(i, n+1){
        int a; cin >> a;
        if(idx[a-1] == 0) idx[a-1] = i+1;
        else dif = i+1 - idx[a-1];
    }
    REP(i, n+1){
        cout << (comb(n+1, i+1) - comb(n-dif, i)) % MOD << "\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'll comb(int, int)':
a.cc:50:24: error: 'reuturn' was not declared in this scope
   50 |     if(a < 0 || b < 0) reuturn 0;
      |                        ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

const int MAX = 510000;
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 calcComb(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;
}

int main() {
    int n;
    cin >> n;
    vector<ll> a(n + 1);
    // 1からnまでの数字+1
    set<int> s;
    map<int, int> pos;
    pair<int, int> target;
    REP(i, n + 1) {
        cin >> a[i];
        if(s.count(a[i]) == 0) {
            s.insert(a[i]);
        } else {
            target = make_pair(pos[a[i]], i);
        }
        pos[a[i]] = i;
    }
    COMinit();
    // cout << "target.first" << target.first << " traget.second " <<
    // target.second
    << endl;
    // http://tutuz.hateblo.jp/entry/2018/08/03/082509
    //同じ数字はちょうど1組
    //重複するのはどちらから選んでいるかわからないとき
    //重複するのが一つ含まれていて
    //最も左よりもひだりと最も右よりも右のもの詰まる
    // l-1+n-r C k-1

    for(int k = 1; k <= n + 1; k++) {
        ll all = calcComb(n + 1, k);
        if(target.first > target.second) {
            cout << "WA" << endl;
            return -1;
        }
        ll sub = calcComb(n - target.second + target.first, k - 1);
        // cout << "-----------------" << endl;
        // cout << n - target.second + target.first << " " << k - 1 << endl;
        // cout << all << " " << sub << endl;
        ll ans = all - sub + MOD;
        ans %= MOD;
        cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:78:5: error: expected primary-expression before '<<' token
   78 |     << endl;
      |     ^~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

typedef long long ll;
const int mod = 1000000007;
const int MAX_N = 100005;

ll fact[MAX_N];         // 階乗
ll ifact[MAX_N];        // 階乗の逆元

// x^nを求める繰り返し二乗法(累乗の高速化)
// フェルマーの小定理より、逆元を計算するときに用いる。
ll mod_pow(ll x, int n){
    if(n == 0)      return 1;

    ll res = 1;
    while(n > 0){
        if(n & 1)   res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }

    return res;
}

// 階乗とその逆元テーブルを(0-n)まで埋める
void table(int n){
    fact[0] = 1;    // i^0 = 1;
    for(int i = 1; i <= n; ++i){
        fact[i] = fact[i - 1] * i % mod;
    }

    // フェルマーの小定理を利用して、右端の逆元を求める
    // 階乗の(mod-2)乗
    ifact[n] = mod_pow(fact[n], mod - 2);

    // 逆元の性質を利用して、テーブルを埋める
    for(int i = n; i >= 1; --i){
        ifact[i - 1] = ifact[i] * i % mod;
    }
}

// nCrを求める
ll combination(int n, int r){
    if(n < 0 || r < 0 || n < r)     return 0;

    return fact[n] * ifact[r] % mod * ifact[n - r] % mod;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n, id1 = 0, id2 = 0;
    cin >> n;
    vector<int> a(n+1), cnt(n+1, 0);
    for(int i = 0; i < n+1; ++i){
        cin >> a[i];
        ++cnt[a[i]];
        
        if(cnt[a[i]] == 2)      id2 = i;   
    }
    for(int i = 0; i < n+1; ++i){
        if(a[i] == a[id2]){
            id1 = i;
            break;
        }
    }
    
    table(n+2);
    
    // 重複している数字をxとして、xの左にある数字の個数
    // a = [...x.....x...]
    int num1 = id1;
    // xの右側にある数字の個数
    int num2 = n - id2;
    
    ll MOD = (ll)mod
    // 重複している数字：x
    for(int i = 1; i <= n+1; ++i){        // 数字をi個取る
        ll res = combination(n + 1, i) - combination(num1 + num2, i - 1) + 5 * MOD % mod;
        
        cout << res << "\n";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:82:5: error: expected ',' or ';' before 'for'
   82 |     for(int i = 1; i <= n+1; ++i){        // 数字をi個取る
      |     ^~~
a.cc:82:20: error: 'i' was not declared in this scope
   82 |     for(int i = 1; i <= n+1; ++i){        // 数字をi個取る
      |                    ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

//typedef long long ll;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

//配列のSIZEは問題ごとに定義する必要がある。
const int SIZE=200'010
long long inv[SIZE+1];//各iの逆元を格納する配列。
long long kai[SIZE+1];//i!のmodを格納する配列。
long long invkai[SIZE+1];//各i!の逆元を格納する配列。
const int MOD=i_7;
void invinit(){//上の配列を初期化する関数。
    inv[1]=1;
    for(int i=2;i<=SIZE;i++){
        inv[i] = MOD - ((MOD/i)*inv[MOD%i])%MOD;
    }
    
    kai[0]=invkai[0]=1;
    for(int i=1;i<=SIZE;i++){
        kai[i]=(kai[i-1]*i)%MOD;
        invkai[i]=(invkai[i-1]*inv[i])%MOD;
    }
}

long long comb(long long a, long long b){
    if(b<0 || a<b){
        return 0;
    }
    return mod(kai[a]*mod(invkai[b]*invkai[a-b]));
}

int main(){
  invinit();
  int n;
  cin>>n;
  int a[n];
  map<int,int> mp;
  int fi=-1,si=-1;//2回出てくる要素の位置
  REP(i,n){
    cin>>a[i];
    mp[a[i]]++;
    if(mp[a[i]]==2){
      si=i;
    }
  }
  REP(i,n){
    if(a[i]==a[si]){
      fi=i;
      break;
    }
  }
  long long ans;
  long long sur=0;
  REPP(k,n+1){
    ans = comb((long long)n+1,(long long)k);
    sur = comb((long long)fi+(long long)n-1-(long long)si,(long long)k-1);
    ans = mod(ans - sur);
    cout<<ans<<endl;
    sur = 0;
  }
  return 0;
  
}


Compiler output:
a.cc:29:1: error: expected ',' or ';' before 'long'
   29 | long long inv[SIZE+1];//各iの逆元を格納する配列。
      | ^~~~
a.cc: In function 'void invinit()':
a.cc:34:5: error: 'inv' was not declared in this scope; did you mean 'int'?
   34 |     inv[1]=1;
      |     ^~~
      |     int
Language: C++

#include<iostream>
#include<map>
#include<vector>
using namespace std;
const int MAX=210000;
const long long MOD=1000000007;

typedef long long ll;

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

ll mod_pow(ll x, ll n){ //べき乗
    ll ans=1;
    while(n!=0){
        if(n&1) ans=ans*x%MOD;
        x=x*x%MOD;
        n=n>>1;
    }
    return ans;
}

void com_init(){ //初期化
    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;
        finv[i]=finv[i-1]*mod_pow(i,MOD-2)%MOD;//フェルマーの小定理より
    }
}

ll comb(ll n, ll k){ //nCk
    if(n<k) return 0;
    if(n<0||k<0) return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}

int main(){
    com_init();
    int n;
    cin >> n;
    vector<int> a(n+1);
    map<int,int> res;
    for(int i=0;i<=n;i++){
        cin >> a[i];
        res[a[i]]++;
    }
    int val;
    for(auto it=res.begin();it!=res.end();it++){
        if(it->second==2){
            val=it->first;
        }
    }
    int left,right;
    int cnt=0;
    for(int i=0;i<=n;i++){
        if(a[i]==val&&cnt==0){
            left=i;
            cnt++;
        }else if(a[i]==val&&cnt==1){
            right=n-i;
        }
    }
    for (int k = 1; k <= n+1; ++k) {
        long long res = 0;
        res = (res + comb(n+1, k)) % MOD;
        res = (res - comb(left + n-right, k-1) + MOD) % MOD;
 
        cout << res << endl;
    }
}    
}


Compiler output:
a.cc:74:1: error: expected declaration before '}' token
   74 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
#define MOD 1000000007
//int kaijo(int n){
	//int ans=1;
	//for(int i=2;i<=n;i++){
	//	ans*=i;
	//	ans%=MOD;
	//}
	//return ans;
//}
int modpow(int a,int b){
	if(b==0)return 1;
	if(b%2)return modpow(a,b-1)*a%MOD;
	return modpow(a,b/2)*modpow(a,b/2)%MOD;
}
//int comb(int a,int b){
	//return kaijo(a)*modpow(kaijo(a-b),MOD-2)%MOD*modpow(kaijo(b),MOD-2)%MOD;
//}
int kaijo[114514];
void init_kaijo(){
	kaijo[0]=1;
	for(int i=1;i<=114513;i++)kaijo[i]=kaijo[i-1]*i%MOD;
}
int comb(int a,int b){
	if(b>a)return 0;
	return kaijo[a]*modpow(kaijo[a-b],MOD-2)%MOD*modpow(kaijo[b],MOD-2)%MOD;
}
int n,l,r;
signed main(){
	cin>>n;
	init_kaijo();
	vector<pair<int,int>>v;
	rep(i,n+1){
		int a;
		cin>>a;
		v.push_back({a,i})
	}
	sort(v.begin(),v.end());
	rep(i,n){
		if(v[i].first==v[i+1].first){
			l=v[i].second,r=v[i+1].second;
			break;
		}
	}
	int s=n-(r-l);
	for(int k=1;k<=n+1;k++){
		cout<<(comb(n+1,k)-comb(s,k-1)+MOD)%MOD;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:35: error: expected ';' before '}' token
   39 |                 v.push_back({a,i})
      |                                   ^
      |                                   ;
   40 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
#define MOD 1000000007
//int kaijo(int n){
	//int ans=1;
	//for(int i=2;i<=n;i++){
	//	ans*=i;
	//	ans%=MOD;
	//}
	//return ans;
//}
int modpow(int a,int b){
	if(b==0)return 1;
	if(b%2)return modpow(a,b-1)*a%MOD;
	return modpow(a,b/2)*modpow(a,b/2)%MOD;
}
//int comb(int a,int b){
	//return kaijo(a)*modpow(kaijo(a-b),MOD-2)%MOD*modpow(kaijo(b),MOD-2)%MOD;
//}
int kaijo[114514];
void init_kaijo(){
	kaijo[0]=1;
	for(int i=1;i<=114513;i++)kaijo[i]=kaijo[i-1]*i%MOD;
}
int comb(int a,int b){
	if(b>a)return 0;
	return kaijo[a]*modpow(kaijo[a-b],MOD-2)%MOD*modpow(kaijo[b],MOD-2)%MOD;
}
int n,a[114514],cnt[114514],memo,l=-1,r,dif;
int C[114514][2];
signed main(){
	cin>>n;
	init_kaijo();
	rep(i,n+1){
		cin>>a[i];
		cnt[a[i]]++;
	}
	for(int i=1;i<=n;i++)if(cnt[i]==2)memo=i;
	rep(i,n+1){
		if(memo==a[i]){
			if(l==-1)l=i;
			else r=i;
		}
	}
	int s=n-(r-l);
	for(int k=1;k<=n+1;k++){
		cout<<(comb(n+1,i)-comb1(s,i-1)+MOD)%MOD;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:33: error: 'i' was not declared in this scope
   49 |                 cout<<(comb(n+1,i)-comb1(s,i-1)+MOD)%MOD;
      |                                 ^
a.cc:49:36: error: 'comb1' was not declared in this scope; did you mean 'comb'?
   49 |                 cout<<(comb(n+1,i)-comb1(s,i-1)+MOD)%MOD;
      |                                    ^~~~~
      |                                    comb
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
#define MOD 1000000007
//int kaijo(int n){
	//int ans=1;
	//for(int i=2;i<=n;i++){
	//	ans*=i;
	//	ans%=MOD;
	//}
	/return ans;
//}
int modpow(int a,int b){
	if(b==0)return 1;
	if(b%2)return modpow(a,b-1)*a%MOD;
	return modpow(a,b/2)*modpow(a,b/2)%MOD;
}
//int comb(int a,int b){
	//return kaijo(a)*modpow(kaijo(a-b),MOD-2)%MOD*modpow(kaijo(b),MOD-2)%MOD;
//}
int kaijo[114514];
int comb(int a,int b){
	return kaijo[a]*modpow(kaijo[a-b],MOD-2)%MOD*modpow(kaijo[b],MOD-2)%MOD;
}
int n,a[114514],cnt[114514],memo,l=-1,r,dif;
int C[114514][2];
signed main(){
	cin>>n;
	kaijo[0]=1;
	for(int i=1;i<=114513;i++)kaijo[i]=kaijo[i-1]*i%MOD;
	rep(i,n+1){
		cin>>a[i];
		cnt[a[i]]++;
	}
	for(int i=1;i<=n;i++)if(cnt[i]==2)memo=i;
	rep(i,n+1){
		if(memo==a[i]){
			if(l==-1)l=i;
			else r=i;
		}
	}
	for(int k=0;k<=n+1;k++){
		if(k){
			if(n-(r-l)>=k-1)C[n-(r-l)][0]=comb(n-(r-l),k-1);
			else C[n-(r-l)][0]=0;
		}
		if(n-(r-l)>=k-1)C[n+1][1]=comb(n+1,k);
	}
	for(int k=1;k<=n+1;k++){
		int a=C[n+1][1];
		int b=C[n-(r-l)][0];
		cout<<(a+MOD-b)%MOD<<endl;
	}
	return 0;
}


Compiler output:
a.cc:12:9: error: expected unqualified-id before '/' token
   12 |         /return ans;
      |         ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
#define MOD 1000000007
int kaijo(int n){
	int ans=1;
	for(int i=2;i<=n;i++){
		ans*=i;
		ans%=MOD;
	}
	return ans;
}
int modpow(int a,int b){
	if(b==0)return 1;
	if(b%2)return modpow(a,b-1)*a%MOD;
	return modpow(a,b/2)*modpow(a,b/2)%MOD;
}
int comb(int a,int b){
	return kaijo(a)*modpow(kaijo(a-b),MOD-2)%MOD*modpow(kaijo(b),MOD-2)%MOD;
}
int n,a[114514],cnt[114514],memo,l=-1,r,dif;
int C[114514][2];
signed main(){
	cin>>n;
	rep(i,n+1){
		cin>>a[i];
		cnt[a[i]]++;
	}
	for(int i=1;i<=n;i++)if(cnt[i]==2)memo=i;
	rep(i,n+1){
		if(memo==a[i]){
			if(l==-1)l=i;
			else r=i;
		}
	}
	for(int k=0;k<=n+1;k++){
		if(i)C[n-(r-l)][0]=comb(n-(r-l),k-1);
		if(n-(r-l)>=k-1)C[n+1][1]=0;
		else C[n+1][1]=comb(n+1,k);
	for(int k=1;k<=n+1;k++){
		int a=C[n+1][1];
		int b=C[n-(r-l)][0];
		cout<<(a+MOD-b)%MOD<<endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:20: error: 'i' was not declared in this scope
   38 |                 if(i)C[n-(r-l)][0]=comb(n-(r-l),k-1);
      |                    ^
a.cc:47:2: error: expected '}' at end of input
   47 | }
      |  ^
a.cc:24:14: note: to match this '{'
   24 | signed main(){
      |              ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
#define MOD 1000000007
int kaijo(int n){
	int ans=1;
	for(int i=2;i<=n;i++){
		ans*=i;
		ans%=MOD;
	}
	return ans;
}
int modpow(int a,int b){
	if(b==0)return 1;
	if(b%2)return modpow(a,b-1)*a%MOD;
	return modpow(a,b/2)*modpow(a,b/2)%MOD;
}
int comb(int a,int b){
	return kaijo(a)*modpow(kaijo(a-b),MOD-2)%MOD*modpow(kaijo(b),MOD-2)%MOD;
}
int n,a[114514],cnt[114514],memo,l=-1,r,dif;
int C[114514][2];
signed main(){
	cin>>n;
	rep(i,n+1){
		cin>>a[i];
		cnt[a[i]]++;
	}
	for(int i=1;i<=n;i++)if(cnt[i]==2)memo=i;
	rep(i,n+1){
		if(memo==a[i]){
			if(l==-1)l=i;
			else r=i;
		}
	}
	for(int i=0;i<=n+1;i++){
		if(i)C[n-(r-l)][0]=comb(n-(r-l),k-1);
		if(n-(r-l)>=k-1)C[n+1][1]=0;
		else C[n+1][1]=comb(n+1,k);
	for(int k=1;k<=n+1;k++){
		int a=C[n+1][1];
		int b=C[n-(r-l)][0];
		cout<<(a+MOD-b)%MOD<<endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:49: error: 'k' was not declared in this scope
   38 |                 if(i)C[n-(r-l)][0]=comb(n-(r-l),k-1);
      |                                                 ^
a.cc:39:29: error: 'k' was not declared in this scope
   39 |                 if(n-(r-l)>=k-1)C[n+1][1]=0;
      |                             ^
a.cc:47:2: error: expected '}' at end of input
   47 | }
      |  ^
a.cc:24:14: note: to match this '{'
   24 | signed main(){
      |              ^
Language: C++

#include <bits/stdc++.h>
//#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
#define all(v) v.begin(),v.end()
int kaijo(int n){
	int ans=1;
	for(int i=2;i<=n;i++){
		ans*=i;
		ans%=MOD;
	}
	return ans;
}
int modpow(int a,int b){
	if(b==0)return 1;
	if(b%2)return modpow(a,b-1)*a%MOD;
	return modpow(a,b/2)*modpow(a,b/2)%MOD;
}
int comb(int a,int b){
	return kaijo(a)*modpow(kaijo(a-b),MOD-2)%MOD*modpow(kaijo(b),MOD-2)%MOD;
}
int n,a[114514],cnt[114514],memo,l=-1,r,dif;
signed main(){
	cin>>n;
	rep(i,n+1){
		cin>>a[i];
		cnt[a[i]]++;
	}
	for(int i=1;i<=n;i++)if(cnt[i]==2)memo=i;
	rep(i,n+1){
		if(memo==a[i]){
			if(l==-1)l=i;
			else r=i;
		}
	}
	dif=r-l;
	for(int k=1;k<=n+1;i++){
		int a=comb(n+1,k);
		int b=comb(dif-1+n,k-1);
		cout<<(a+MOD-b)%MOD<<endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int kaijo(int)':
a.cc:10:22: error: 'MOD' was not declared in this scope
   10 |                 ans%=MOD;
      |                      ^~~
a.cc: In function 'int modpow(int, int)':
a.cc:16:39: error: 'MOD' was not declared in this scope
   16 |         if(b%2)return modpow(a,b-1)*a%MOD;
      |                                       ^~~
a.cc:17:44: error: 'MOD' was not declared in this scope
   17 |         return modpow(a,b/2)*modpow(a,b/2)%MOD;
      |                                            ^~~
a.cc: In function 'int comb(int, int)':
a.cc:20:43: error: 'MOD' was not declared in this scope
   20 |         return kaijo(a)*modpow(kaijo(a-b),MOD-2)%MOD*modpow(kaijo(b),MOD-2)%MOD;
      |                                           ^~~
a.cc: In function 'int main()':
a.cc:37:28: error: 'i' was not declared in this scope
   37 |         for(int k=1;k<=n+1;i++){
      |                            ^
a.cc:40:26: error: 'MOD' was not declared in this scope
   40 |                 cout<<(a+MOD-b)%MOD<<endl;
      |                          ^~~
Language: C++

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

ll factorial[200010];
ll inverse_factorial[200010];

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

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

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

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

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

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

int main(){
  int n;cin>>n;
  vi a;map<int, vi> table;
  for (int i=0;i<n+1;++i){
    int a_;cin>>a_;a.push_back(a_);
    table[a_].push_back(i);
    int m=table[a_].size();
    if(m==2) break;
  }

  int p=table[a_][0], q=table[a_][1];
  int l=n-q+p, m=q-p-1;
  for (int k=1;k<=n+1;++k){
    ll ans=comb(n-1, k);
    ans=add(ans, comb(l, k-1));
    ans=add(ans, 2*(sbt(comb(n-1, k-1),comb(l, k-1))));
    ans=add(ans, comb(n-2, k-2));
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:15: error: 'a_' was not declared in this scope; did you mean 'a'?
   53 |   int p=table[a_][0], q=table[a_][1];
      |               ^~
      |               a
a.cc:54:11: error: 'q' was not declared in this scope
   54 |   int l=n-q+p, m=q-p-1;
      |           ^
Language: C++

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

ll factorial[200010];
ll inverse_factorial[200010];

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

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

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

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

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

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

int main(){
  int n;cin>>n;
  vi a;map<int, vi> table;
  for (int i=0;i<N+1;++i){
    int a_;cin>>a_;a.push_back(a_);
    table[a_].push_back(i);
    int m=table[a_].size();
    if(m==2) break;
  }

  int p=table[a_][0], q=table[a_][1];
  int l=n-q+p, m=q-p-1;
  for (int k=1;k<=n+1;++k){
    ll ans=comb(n-1, k);
    ans=add(ans, comb(l, k-1));
    ans=add(ans, 2*(sbt(comb(n-1, k-1),comb(l, k-1))));
    ans=add(ans, comb(n-2, k-2));
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:18: error: 'N' was not declared in this scope
   46 |   for (int i=0;i<N+1;++i){
      |                  ^
a.cc:53:15: error: 'a_' was not declared in this scope; did you mean 'a'?
   53 |   int p=table[a_][0], q=table[a_][1];
      |               ^~
      |               a
a.cc:54:11: error: 'q' was not declared in this scope
   54 |   int l=n-q+p, m=q-p-1;
      |           ^
Language: C

#include<stdio.h>

#define mod 1000000007

int n,i,a[100001],r,l,f[100001]={0};

long long mol(long long a,long long b){
		if(b==1)return a;
		if(b%2==0){
				long long t=mol(a,b/2);
				return (t*t)%mod;
		}
		return (a*mol(a,b-1))%mod;
}

long long div(long long a,long long b){
		return (a*(mol(b,mod-2)))%mod;
}

long long kaijo(long long a){
		if(a<1)return 1;
		return (a*kaijo(a-1))%mod;
}

long long nn=kaijo(n+1);
long long nnlr=kaijo(-r+l+n);

long long ncm(int a,int b){
		long long r;
		if(a==n+1)r=nn;
		else r=nnlr
		long long rr=kaijo(b);
		long long rrr=kaijo(a-b);
		return div(div(r,rr)%mod,rrr)%mod;
}

int main(){
		scanf("%d",&n);
		for(i=0;i<=n;i++)scanf("%d",&a[i]);
		for(i=0;i<=n;i++){
				if(f[a[i]]==1)r=i;
				f[a[i]]++;
		}
		for(i=0;i<=n;i++){
				if(f[a[i]]==2){
						l=i;
						break;
				}
		}
		for(i=1;i<=n+1;i++){
				printf("%lld\n",(mod+ncm(n+1,i)-(-r+l+n>=i-1?ncm(-r+l+n,i-1):0))%mod);
		}
		return 0;
}


Compiler output:
main.c:25:14: error: initializer element is not constant
   25 | long long nn=kaijo(n+1);
      |              ^~~~~
main.c:26:16: error: initializer element is not constant
   26 | long long nnlr=kaijo(-r+l+n);
      |                ^~~~~
main.c: In function 'ncm':
main.c:31:28: error: expected ';' before 'long'
   31 |                 else r=nnlr
      |                            ^
      |                            ;
   32 |                 long long rr=kaijo(b);
      |                 ~~~~        
main.c:34:34: error: 'rr' undeclared (first use in this function); did you mean 'rrr'?
   34 |                 return div(div(r,rr)%mod,rrr)%mod;
      |                                  ^~
      |                                  rrr
main.c:34:34: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <functional>
#include <vector>
#include <queue>
#include <map>
#include <stack>

using namespace std;

typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)

int const N_MAX = 100000;
ll const MOD = 1000000007;

int n;
int a[N_MAX + 2];
ll comb[N_MAX + 2][N_MAX + 2];
int dups[N_MAX + 2];

ll dp(ll n, ll r) {
  if (n < r) return 0;
  if (comb[n][r]) return comb[n][r];
  if (comb[n][n - r]) return comb[n][r] = comb[n][n - r];
  if (r == 0) return comb[n][r] = 1;

  return comb[n][r] = dp(n - 1, r - 1) + dp(n - 1, r);
}

int main() {
  cin >> n;
  int d;
  rep(i, n + 1) {
    int b;
    scanf("%d", &b);
    a[i] = b;
    if (dups[b]) d = b;
    dups[b]++;
  }
  vector<int> lr;
  rep(i, n + 1) {
    if (d == a[i]) {
      lr.push_back(i);
    }
  }
  int l = lr[0] + 1;
  int r = lr[1] + 1;

  FOR(k, 1, n + 1) {
    printf("%lld\n", (dp(n + 1, k) - dp(l - 1 + n + 1 - r, k - 1)) % MOD);
  }
  printf("1\n");
}


Compiler output:
/tmp/ccECHb4k.o: in function `main':
a.cc:(.text+0x276): relocation truncated to fit: R_X86_64_PC32 against symbol `dups' defined in .bss section in /tmp/ccECHb4k.o
a.cc:(.text+0x298): relocation truncated to fit: R_X86_64_PC32 against symbol `dups' defined in .bss section in /tmp/ccECHb4k.o
a.cc:(.text+0x2af): relocation truncated to fit: R_X86_64_PC32 against symbol `dups' defined in .bss section in /tmp/ccECHb4k.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <map>
#include <cmath>



long long mod(long long  a, long long b)
{
    return a - long long(std::floor(double(a) / b)) * b;
}

long long power_func(long long a, long long b, long long p) {
    if (b == 0) return 1;
    if (b % 2 == 0){
        long long d = power_func(a, b / 2, p);
        return (d * d) % p;
    }
    //if (b % 2 == 1)
    return (a*power_func(a, b - 1, p)) % p;
}

class comb_calclator {
public:
    comb_calclator(int N, long long p):
        N(N),
        p(p),
        frac_N(N + 1, 0)
    {
        frac_N[0] = 1;
        for (int i = 1; i <= N; i++) {
            frac_N[i] = (frac_N[i - 1] * i) % p;
        }
    }
    
    long long comb(int n, int r) {
        if ((n < 0) || (r < 0) || (n < r)) return 0;
        if ((n == 0) || (r == 0)) return 1;
        long long a = frac_N[n];
        long long b = frac_N[r];
        long long c = frac_N[n - r];
        if (power_N.count(r) == 0)
            power_N[r] = power_func(b, p - 2, p);
        if (power_N.count(n - r) == 0)
            power_N[n - r] = power_func(c, p - 2, p);
        return (a * ((power_N[r] * power_N[n - r])  % p)) % p;
    }

private:
    int N;
    long long p;
    std::vector<long long> frac_N;
    std::map<int, long long> power_N;
};

int main()
{
    int n, N;
    std::cin >> n;
    N = n + 1;
    //std::vector<int> A;
    std::map<int, int> idx_map;
    int first_idx, second_idx;
    for (int i = 0; i < N; i++) {
        int a;
        std::cin >> a;
        if (idx_map.count(a) == 0)
            idx_map[a] = i;
        else {
            first_idx = idx_map[a];
            second_idx = i;
        }
    }
    comb_calclator cc(N, 1000000007);
    int sub_N = N - second_idx + first_idx;
    for (int k = 1; k < N + 1; k++) {
        long long sub1 = 0;
        if (k <= sub_N) {
            sub1 = cc.comb(sub_N - 1, k - 1);
        }
        std::cout << mod((cc.comb(N, k) - sub1), 1000000007) << std::endl;
    }
    return 0;
}



Compiler output:
a.cc: In function 'long long int mod(long long int, long long int)':
a.cc:12:16: error: expected primary-expression before 'long'
   12 |     return a - long long(std::floor(double(a) / b)) * b;
      |                ^~~~
a.cc:12:15: error: expected ';' before 'long'
   12 |     return a - long long(std::floor(double(a) / b)) * b;
      |               ^~~~~
      |               ;
a.cc:12:16: error: expected primary-expression before 'long'
   12 |     return a - long long(std::floor(double(a) / b)) * b;
      |                ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <map>



long long mod(long long  a, long long b)
{
    return a - std::floor(a / b) * b;
}

long long power_func(long long a, long long b, long long p) {
    if (b == 0) return 1;
    if (b % 2 == 0){
        long long d = power_func(a, b / 2, p);
        return (d * d) % p;
    }
    //if (b % 2 == 1)
    return (a*power_func(a, b - 1, p)) % p;
}

class comb_calclator {
public:
    comb_calclator(int N, long long p):
        N(N),
        p(p),
        frac_N(N + 1, 0)
    {
        frac_N[0] = 1;
        for (int i = 1; i <= N; i++) {
            frac_N[i] = (frac_N[i - 1] * i) % p;
        }
    }
    
    long long comb(int n, int r) {
        if ((n < 0) || (r < 0) || (n < r)) return 0;
        if ((n == 0) || (r == 0)) return 1;
        long long a = frac_N[n];
        long long b = frac_N[r];
        long long c = frac_N[n - r];
        if (power_N.count(r) == 0)
            power_N[r] = power_func(b, p - 2, p);
        if (power_N.count(n - r) == 0)
            power_N[n - r] = power_func(c, p - 2, p);
        return (a * ((power_N[r] * power_N[n - r])  % p)) % p;
    }

private:
    int N;
    long long p;
    std::vector<long long> frac_N;
    std::map<int, long long> power_N;
};

int main()
{
    int n, N;
    std::cin >> n;
    N = n + 1;
    //std::vector<int> A;
    std::map<int, int> idx_map;
    int first_idx, second_idx;
    for (int i = 0; i < N; i++) {
        int a;
        std::cin >> a;
        if (idx_map.count(a) == 0)
            idx_map[a] = 1;
        else {
            first_idx = idx_map[a];
            second_idx = i;
        }
    }
    comb_calclator cc(N, 1000000007);
    int sub_N = N - second_idx + first_idx;
    for (int k = 1; k < N + 1; k++) {
        long long sub1 = 0;
        if (k <= sub_N) {
            sub1 = cc.comb(sub_N - 1, k - 1);
        }
        std::cout << (cc.comb(N, k) - sub1) % 1000000007 << std::endl;
    }
    return 0;
}



Compiler output:
a.cc: In function 'long long int mod(long long int, long long int)':
a.cc:11:21: error: 'floor' is not a member of 'std'
   11 |     return a - std::floor(a / b) * b;
      |                     ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
typedef int64_t llong;
char moji[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char moji2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());
#define ld PRId64
#define n_max 100000
#define mod 1000000007
#define inv 1000000005

 

llong inverse(llong a){
    llong ans=1;
    llong tmp=a;
    llong beki=inv;
    while(beki > 0){
        if(beki & 1) ans=ans*tmp % mod;
        tmp*=tmp;
        tmp%=mod;
        beki >>=1;
    }
    return ans;
}

void mk_com(llong com[],llong n){
    com[0]=1;

    for(llong i=0; i< n ; i++){
        com[i+1] = com[i] *  (n-i)%mod;
        com[i+1] = com[i+1] *inverse(i+1) %mod;
    }
}

int main(){
    llong n;
    cin >> n;
    int judge[n_max]={};
    REP(i,n_max) judge[i] = -1; 
    int tmp;
    llong doub;
    REP(i,n){
        scanf("%d",&tmp);
        if(judge[tmp] != -1) doub = n+1-(i - judge[tmp] +1);
        else judge[tmp] =i;
    }
    llong allcom[n_max];
    llong subcom[n_max];
    mk_com(allcom,n+1);
    mk_com(subcom,doub);

    if(doub==0) subcom={};
    FOR(i,1,n+2){
        if(i-1 <= doub) printf("%ld\n",(allcom[i] + mod - subcom[i-1])%mod );
        else printf("%ld\n",allcom[i]);
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:23: error: assigning to an array from an initializer list
   59 |     if(doub==0) subcom={};
      |                 ~~~~~~^~~