Language: C++

#include "bits/stdc++.h" // {{{
#undef DEBUG
using namespace std;
#define outl(x)     cout << (x) << '\n'
#define rep(i,n)    for(int i=0; i < (int)(n); ++i)
#define ten(p)      ((long long)(1e##p))
#define FILL(a,v)   memset((a), (v), sizeof(a))
#ifdef  DEBUG
#define debug(...)  fprintf(stderr, __VA_ARGS__)
#define show(x)     clog << #x << " \t\t= " << (x) << '\n'
#define show2(x,y)  clog << '(' << #x << ',' << #y << ")\t\t= " << '(' << (x) << "\t, " << (y) << ")\n"
#define LN()        fputs("\n--------------------------------\n", stderr)
#else
#define debug(...)
#define show(x)
#define show2(x,y)
#define LN()
#endif
typedef long long ll;
namespace ydk{
// }}}

#define int long long

constexpr int MX = 3 * ten(5) + 10;

constexpr int MOD = ten(9) + 7;

constexpr ll sqr(const ll &n) { return n*n; }

inline int modPow(ll n, int p)
{
    if (p <= 0) return 1;
    ll x = sqr(modPow(n, p/2)) % MOD;
    if (p & 1) x = x*n % MOD;

    return x;
}

int f[MX], finv[MX];

void init()
{
    f[0] = finv[0] = 1;
    for (ll i = 1; i < MX; ++i) {
        f[i] = i * f[i-1] % MOD;
        finv[i] = modPow(f[i], MOD-2);
    }
    return;
}

int combi(int n, int k)
{
    if (n < k) return 0;
    return 1LL * f[n] * finv[k] % MOD * finv[n-k] % MOD;

}

int p[MX];
int a[MX];

void Xx_main_xX(const signed argc, char *argv[])
{
    int N;
    int l, r;

    init();

    cin >> N;
    ++N;

    rep(i, N) {
        cin >> a[i]; --a[i];
        ++p[a[i]];
    }
    rep(i, N) {
        if (p[a[i]] == 2) {
            l = i;
            break;
        }
    }
    for (int i = N-1; i >= 0; i--) {
        if (p[a[i]] == 2) {
            r = N - i - 1;
            break;
        }
    }

    for (int i = 1; i <= N+1; ++i) {
        ll ans = combi(N, i) - combi(l+r, i-1) % MOD;
        outl(ans);
    }
    return;
}

} // {{{

signed main(signed argc, char *argv[])
{
    ydk::Xx_main_xX(argc, argv); return 0;
} // }}}

#include "bits/stdc++.h" // {{{
#undef DEBUG
using namespace std;
#define outl(x)     cout << (x) << '\n'
#define rep(i,n)    for(int i=0; i < (int)(n); ++i)
#define ten(p)      ((long long)(1e##p))
#define FILL(a,v)   memset((a), (v), sizeof(a))
#ifdef  DEBUG
#define debug(...)  fprintf(stderr, __VA_ARGS__)
#define show(x)     clog << #x << " \t\t= " << (x) << '\n'
#define show2(x,y)  clog << '(' << #x << ',' << #y << ")\t\t= " << '(' << (x) << "\t, " << (y) << ")\n"
#define LN()        fputs("\n--------------------------------\n", stderr)
#else
#define debug(...)
#define show(x)
#define show2(x,y)
#define LN()
#endif
typedef long long ll;
namespace ydk{
// }}}

#define int long long

constexpr int MX = 3 * ten(5) + 10;

constexpr int MOD = ten(9) + 7;

constexpr ll sqr(const ll &n) { return n*n; }

inline int modPow(ll n, int p)
{
    if (p <= 0) return 1;
    ll x = sqr(modPow(n, p/2)) % MOD;
    if (p & 1) x = x*n % MOD;

    return x;
}

int f[MX], finv[MX];

void init()
{
    f[0] = finv[0] = 1;
    for (ll i = 1; i < MX; ++i) {
        f[i] = i * f[i-1] % MOD;
        finv[i] = modPow(f[i], MOD-2);
    }
    return;
}

int combi(int n, int k)
{
    if (n < k) return 0;
    return 1LL * f[n] * finv[k] % MOD * finv[n-k] % MOD;

}

int p[MX];
int a[MX];

void Xx_main_xX(const signed argc, char *argv[])
{
    int N;
    int l, r;

    init();

    cin >> N;
    ++N;

    rep(i, N) {
        cin >> a[i]; --a[i];
        ++p[a[i]];
    }
    rep(i, N) {
        if (p[a[i]] == 2) {
            l = i;
            break;
        }
    }
    for (int i = N-1; i >= 0; i--) {
        if (p[a[i]] == 2) {
            r = N - i - 1;
            break;
        }
    }

    for (int i = 1; i <= N+1; ++i) {
        ll ans = combi(N, i) - combi(l+r, i-1) % MOD;
        outl(ans);
    }
    return;
}

} // {{{

signed main(signed argc, char *argv[])
{
    ydk::Xx_main_xX(argc, argv); return 0;
} // }}}



Compiler output:
a.cc:127:15: error: redefinition of 'constexpr const long long int ydk::MX'
  127 | constexpr int MX = 3 * ten(5) + 10;
      |               ^~
a.cc:25:15: note: 'constexpr const long long int ydk::MX' previously defined here
   25 | constexpr int MX = 3 * ten(5) + 10;
      |               ^~
a.cc:129:15: error: redefinition of 'constexpr const long long int ydk::MOD'
  129 | constexpr int MOD = ten(9) + 7;
      |               ^~~
a.cc:27:15: note: 'constexpr const long long int ydk::MOD' previously defined here
   27 | constexpr int MOD = ten(9) + 7;
      |               ^~~
a.cc:131:14: error: redefinition of 'constexpr ll ydk::sqr(const ll&)'
  131 | constexpr ll sqr(const ll &n) { return n*n; }
      |              ^~~
a.cc:29:14: note: 'constexpr ll ydk::sqr(const ll&)' previously defined here
   29 | constexpr ll sqr(const ll &n) { return n*n; }
      |              ^~~
a.cc:133:12: error: redefinition of 'long long int ydk::modPow(ll, long long int)'
  133 | inline int modPow(ll n, int p)
      |            ^~~~~~
a.cc:31:12: note: 'long long int ydk::modPow(ll, long long int)' previously defined here
   31 | inline int modPow(ll n, int p)
      |            ^~~~~~
a.cc:142:5: error: redefinition of 'long long int ydk::f [300010]'
  142 | int f[MX], finv[MX];
      |     ^
a.cc:40:5: note: 'long long int ydk::f [300010]' previously declared here
   40 | int f[MX], finv[MX];
      |     ^
a.cc:142:12: error: redefinition of 'long long int ydk::finv [300010]'
  142 | int f[MX], finv[MX];
      |            ^~~~
a.cc:40:12: note: 'long long int ydk::finv [300010]' previously declared here
   40 | int f[MX], finv[MX];
      |            ^~~~
a.cc:144:6: error: redefinition of 'void ydk::init()'
  144 | void init()
      |      ^~~~
a.cc:42:6: note: 'void ydk::init()' previously defined here
   42 | void init()
      |      ^~~~
a.cc:154:5: error: redefinition of 'long long int ydk::combi(long long int, long long int)'
  154 | int combi(int n, int k)
      |     ^~~~~
a.cc:52:5: note: 'long long int ydk::combi(long long int, long long int)' previously defined here
   52 | int combi(int n, int k)
      |     ^~~~~
a.cc:161:5: error: redefinition of 'long long int ydk::p [300010]'
  161 | int p[MX];
      |     ^
a.cc:59:5: note: 'long long int ydk::p [300010]' previously declared here
   59 | int p[MX];
      |     ^
a.cc:162:5: error: redefinition of 'long long int ydk::a [300010]'
  162 | int a[MX];
      |     ^
a.cc:60:5: note: 'long long int ydk::a [300010]' previously declared here
   60 | int a[MX];
      |     ^
a.cc:164:6: error: redefinition of 'void ydk::Xx_main_xX(int, char**)'
  164 | void Xx_main_xX(const signed argc, char *argv[])
      |      ^~~~~~~~~~
a.cc:62:6: note: 'void ydk::Xx_main_xX(int, char**)' previously defined here
   62 | void Xx_main_xX(const signed argc, char *argv[])
      |      ^~~~~~~~~~
a.cc:200:8: error: redefinition of 'int main(int, char**)'
  200 | signed main(signed argc, char *argv[])
      |        ^~~~
a.cc:98:8: note: 'int main(int, char**)' previously defined here
   98 | signed main(signed argc, char *argv[])
      |        ^~~~