Language: Java

// copied
#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef double DB;
typedef unsigned int UI;
typedef pair<int, int> PII;

const int inf = 0x7f7f7f7f;

#define rdi() read<int>()
#define rdl() read<LL>()
#define rds(a) scanf("%s", a)
#define mk(i, j) make_pair(i, j)
#define pb push_back
#define fi first
#define se second
#define For(i, j, k) for (int i = j; i <= k; i ++)
#define Rep(i, j, k) for (int i = j; i >= k; i --)
#define Edge(i, u) for (int i = head[u]; i; i = e[i].nxt)

template<typename t> t read() {
    t x = 0; int f = 1; char c = getchar();
    while (c > '9' || c < '0') f = c == '-' ? -1 : 1 , c = getchar();
    while (c >= '0' && c <= '9') x = x * 10 + c - 48 , c = getchar();
    return x * f;
}

template<typename t> void write(t x) {
    if (x < 0){
        putchar('-'), write(-x);
        return;
    }
    if (x >= 10) write(x / 10);
    putchar(x % 10 + 48);
}

const int P = 1e9 + 7;
const int N = 1e5 + 10;
int fac[N], facinv[N], a[N], n, pos, vis[N], id;

int power(int a, int b) {
    int c = 1;
    for (; b; b >>= 1, a = 1ll * a * a % P) if (b & 1) c = 1ll * c * a % P;
    return c;
}

int C(int x, int y) {
    return 1ll * fac[x] * facinv[y] % P * facinv[x - y] % P;
}

int main() {
    n = rdi() + 1;
    for (int i = 1; i <= n; i ++) a[i] = rdi();
    fac[0] = fac[1] = 1;
    for (int i = 2; i <= n; i ++) fac[i] = 1ll * fac[i - 1] * i % P;
    facinv[n] = power(fac[n], P - 2);
    for (int i = n - 1; i >= 0; i --) facinv[i] = 1ll * facinv[i + 1] * (i + 1) % P;
    for (int i = 1; i <= n; i ++) {
        if (vis[a[i]]) {
            pos = i;
            id = a[i];
            break;
        }
        vis[a[i]] = i;
    }
    int len = n - pos + 1;
    for (int i = 1; i <= n; i ++) {
        int ans = C(n, i);
        if (i - 1 <= len - 1 + vis[id] - 1) ans -= C(len - 1 + vis[id] - 1, i - 1);
        ans = (ans + P) % P;
        write(ans), putchar(10);
    }
    return 0;
}


Compiler output:
Main.java:2: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:2: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:6: error: class, interface, enum, or record expected
typedef long long LL;
^
Main.java:7: error: class, interface, enum, or record expected
typedef double DB;
^
Main.java:8: error: class, interface, enum, or record expected
typedef unsigned int UI;
^
Main.java:9: error: class, interface, enum, or record expected
typedef pair<int, int> PII;
^
Main.java:11: error: class, interface, enum, or record expected
const int inf = 0x7f7f7f7f;
^
Main.java:13: error: illegal character: '#'
#define rdi() read<int>()
^
Main.java:13: error: class, interface, enum, or record expected
#define rdi() read<int>()
        ^
Main.java:14: error: illegal character: '#'
#define rdl() read<LL>()
^
Main.java:15: error: illegal character: '#'
#define rds(a) scanf("%s", a)
^
Main.java:16: error: illegal character: '#'
#define mk(i, j) make_pair(i, j)
^
Main.java:17: error: illegal character: '#'
#define pb push_back
^
Main.java:18: error: illegal character: '#'
#define fi first
^
Main.java:19: error: illegal character: '#'
#define se second
^
Main.java:20: error: illegal character: '#'
#define For(i, j, k) for (int i = j; i <= k; i ++)
^
Main.java:20: error: class, interface, enum, or record expected
#define For(i, j, k) for (int i = j; i <= k; i ++)
                                     ^
Main.java:20: error: class, interface, enum, or record expected
#define For(i, j, k) for (int i = j; i <= k; i ++)
                                             ^
Main.java:21: error: illegal character: '#'
#define Rep(i, j, k) for (int i = j; i >= k; i --)
^
Main.java:21: error: class, interface, enum, or record expected
#define Rep(i, j, k) for (int i = j; i >= k; i --)
                                     ^
Main.java:21: error: class, interface, enum, or record expected
#define Rep(i, j, k) for (int i = j; i >= k; i --)
                                             ^
Main.java:22: error: illegal character: '#'
#define Edge(i, u) for (int i = head[u]; i; i = e[i].nxt)
^
Main.java:22: error: class, interface, enum, or record expected
#define Edge(i, u) for (int i = head[u]; i; i = e[i].nxt)
                                         ^
Main.java:22: error: class, interface, enum, or record expected
#define Edge(i, u) for (int i = head[u]; i; i = e[i].nxt)
                                            ^
Main.java:25: error: unnamed classes are a preview feature and are disabled by default.
    t x = 0; int f = 1; char c = getchar();
             ^
  (use --enable-preview to enable unnamed classes)
Main.java:26: error: class, interface, enum, or record expected
    while (c > '9' || c < '0') f = c == '-' ? -1 : 1 , c = getchar();
    ^
Main.java:27: error: class, interface, enum, or record expected
    while (c >= '0' && c <= '9') x = x * 10 + c - 48 , c = getchar();
    ^
Main.java:28: error: class, interface, enum, or record expected
    return x * f;
    ^
Main.java:29: error: class, interface, enum, or record expected
}
^
Main.java:34: error: class, interface, enum, or record expected
        return;
        ^
Main.java:35: error: class, interface, enum, or record expected
    }
    ^
Main.java:37: error: class, interface, enum, or record expected
    putchar(x % 10 + 48);
    ^
Main.java:38: error: class, interface, enum, or record expected
}
^
Main.java:41: error: class, interface, enum, or record expected
const int N = 1e5 + 10;
^
Main.java:42: error: class, interface, enum, or record expected
int fac[N], facinv[N], a[N], n, pos, vis[N], id;
^
Main.java:46: error: not a statement
    for (; b; b >>= 1, a = 1ll * a * a % P) if (b & 1) c = 1ll * c * a % P;
                                       ^
Main.java:46: error: not a statement
    for (; b; b >>= 1, a = 1ll * a * a % P) if (b & 1) c = 1ll * c * a % P;
                                                                       ^
Main.java:46: error: ')' expected
    for (; b; b >>= 1, a = 1ll * a * a % P) if (b & 1) c = 1ll * c * a % P;
                             ^
Main.java:46: error: ';' expected
    for (; b; b >>= 1, a = 1ll * a * a % P) if (b & 1) c = 1ll * c * a % P;
                                          ^
Main.java:46: error: ';' expected
    for (; b; b >>= 1, a = 1ll * a * a % P) if (b & 1) c = 1ll * c * a % P;
                                                             ^
Main.java:51: error: not a statement
    return 1ll * fac[x] * facinv[y] % P * facinv[x - y] % P;
                                                        ^
Main.java:51: error: ';' expected
    return 1ll * fac[x] * facinv[y] % P * facinv[x - y] % P;
             ^
Main.java:58: error: not a statement
    for (int i = 2; i <= n; i ++) fac[i] = 1ll * fac[i - 1] * i % P;
                                                                ^
Main.java:60: error: not a statement
    for (int i = n - 1; i >= 0; i --) facinv[i] = 1ll * facinv[i + 1] * (i + 1) % P;
                                                                                ^
Main.java:58: error: ';' expected
    for (int i = 2; i <= n; i ++) fac[i] = 1ll * fac[i - 1] * i % P;
                                             ^
Main.java:60: error: ';' expected
    for (int i = n - 1; i >= 0; i --) facinv[i] = 1ll * facinv[i + 1] * (i + 1) % P;
                                                    ^
Main.java:74: error: ';' expected
        write(ans), putchar(10);
                  ^
47 errors