Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N, mod = 10**5+1, 10**9+7
fac = [1, 1] + [None] * N
inv = [0, 1] + [None] * N
facInv = [1, 1] + [None] * N
for i in range(2, N+1):
    fac[i] = i * fac[i-1] % mod
    inv[i] = mod-(inv[mod%i]*(mod//i))%mod
    facInv[i] = facInv[i-1]*inv[i]%mod
def modCom(n, k):
    return 0 if n < k else fac[n] * facInv[k] * facInv[n-k] % mod
n = int(input())
a = list(map(int, input().split()))
for x in range(1, n+1):
    if a.count(x) == 2: break
fi = a.index(x) + 1
si = a[fi:].index(x) + fi + 1
print(n)
for k in range(2, n+1):
    print((modCom(n+1, k) - modCom(fi+n-si, k-1)) % mod)
print(1)


Fixed submission:
from collections import defaultdict
import sys
input = sys.stdin.readline
N, mod = 10**5+1, 10**9+7
fac = [1, 1] + [None] * N
inv = [0, 1] + [None] * N
facInv = [1, 1] + [None] * N
for i in range(2, N+1):
    fac[i] = i*fac[i-1]%mod
    inv[i] = mod-(inv[mod%i]*(mod//i))%mod
    facInv[i] = facInv[i-1]*inv[i]%mod
def modCom(n, k):
    return 0 if n < k else fac[n] * facInv[k] * facInv[n-k] % mod
n = int(input())
a = list(map(int, input().split()))
dic = defaultdict(int)
for i, x in enumerate(a):
    if dic[x] > 0:
        fi = dic[x]
        si = i+1
        break
    dic[x] = i+1
print(n)
for k in range(2, n+1):
    print((modCom(n+1, k) - modCom(fi+n-si, k-1)) % mod)
print(1)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N, mod = 10**5+1, 10**9+7
fac = [1, 1] + [None] * N
inv = [0, 1] + [None] * N
facInv = [1, 1] + [None] * N
for i in range(2, N+1):
    fac[i] = i * fac[i-1] % mod
    inv[i] = mod-(inv[mod%i]*(mod//i))%mod
    facInv[i] = facInv[i-1]*inv[i]%mod
def modCom(n, k):
    return 0 if n < k else fac[n] * facInv[k] * facInv[n-k] % mod
n = int(input())
a = list(map(int, input().split()))
for x in range(1, n+1):
    if a.count(x) == 2: break
fi = a.index(x) + 1
si = a[fi:].index(x) + fi + 1
print(n)
for k in range(2, n+1):
    print((modCom(n+1, k) - modCom(fi+n-si, k-1)) % mod)
print(1)


Fixed submission:
from collections import defaultdict
import sys
input = sys.stdin.readline
N, mod = 10**5+1, 10**9+7
fac = [1, 1] + [None] * N
inv = [0, 1] + [None] * N
facInv = [1, 1] + [None] * N
for i in range(2, N+1):
    fac[i] = i*fac[i-1]%mod
    inv[i] = mod-(inv[mod%i]*(mod//i))%mod
    facInv[i] = facInv[i-1]*inv[i]%mod
def modCom(n, k):
    return 0 if n < k else fac[n] * facInv[k] * facInv[n-k] % mod
n = int(input())
a = list(map(int, input().split()))
dic = defaultdict(int)
for i, x in enumerate(a):
    if dic[x] > 0:
        fi = dic[x]
        si = i+1
        break
    dic[x] = i+1
print(n)
for k in range(2, n+1):
    print((modCom(n+1, k) - modCom(fi+n-si, k-1)) % mod)
print(1)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N, mod = 10**5+2, 10**9+7
def extGcd(a, b):
    if b == 0:
        return a, 1, 0
    else:
        d, x, y = extGcd(b, a % b)
        x -= (a // b) * y
        return d, y, x
def modInv(a):
    return extGcd(a, mod)[1] % mod
fac = [1] + [None] * N
for i in range(1, N+1):
    fac[i] = i * fac[i-1] % mod
facInv = [1] + [None] * N
for i in range(1, N+1):
    facInv[i] = modInv(fac[i])
def modCom(n, k):
    return 0 if n < k else fac[n] * pow(fac[k],mod-2,mod) * pow(fac[n-k],mod-2,mod) % mod
n = int(input())
a = list(map(int, input().split()))
for x in range(1, n+1):
    if a.count(x) == 2: break
fi = a.index(x) + 1
si = a[fi:].index(x) + fi + 1
print(n)
for k in range(2, n+1):
    print((modCom(n+1, k) - modCom(fi+n-si, k-1)) % mod)
print(1)


Fixed submission:
from collections import defaultdict
import sys
input = sys.stdin.readline
N, mod = 10**5+1, 10**9+7
fac = [1, 1] + [None] * N
inv = [0, 1] + [None] * N
facInv = [1, 1] + [None] * N
for i in range(2, N+1):
    fac[i] = i*fac[i-1]%mod
    inv[i] = mod-(inv[mod%i]*(mod//i))%mod
    facInv[i] = facInv[i-1]*inv[i]%mod
def modCom(n, k):
    return 0 if n < k else fac[n] * facInv[k] * facInv[n-k] % mod
n = int(input())
a = list(map(int, input().split()))
dic = defaultdict(int)
for i, x in enumerate(a):
    if dic[x] > 0:
        fi = dic[x]
        si = i+1
        break
    dic[x] = i+1
print(n)
for k in range(2, n+1):
    print((modCom(n+1, k) - modCom(fi+n-si, k-1)) % mod)
print(1)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N, mod = 10**5+2, 10**9+7
fac = [1] + [None] * N
for i in range(1, N+1):
    fac[i] = i * fac[i-1] % mod
def modCom(n, k):
    return 0 if n < k else fac[n] * pow(fac[k],mod-2,mod) * pow(fac[n-k],mod-2,mod) % mod
n = int(input())
a = list(map(int, input().split()))
for x in range(1, n+1):
    if a.count(x) == 2: break
fi = a.index(x) + 1
si = a[fi:].index(x) + fi + 1
print(n)
for k in range(2, n+1):
    print((modCom(n+1, k) - modCom(fi+n-si, k-1)) % mod)
print(1)


Fixed submission:
from collections import defaultdict
import sys
input = sys.stdin.readline
N, mod = 10**5+1, 10**9+7
fac = [1, 1] + [None] * N
inv = [0, 1] + [None] * N
facInv = [1, 1] + [None] * N
for i in range(2, N+1):
    fac[i] = i*fac[i-1]%mod
    inv[i] = mod-(inv[mod%i]*(mod//i))%mod
    facInv[i] = facInv[i-1]*inv[i]%mod
def modCom(n, k):
    return 0 if n < k else fac[n] * facInv[k] * facInv[n-k] % mod
n = int(input())
a = list(map(int, input().split()))
dic = defaultdict(int)
for i, x in enumerate(a):
    if dic[x] > 0:
        fi = dic[x]
        si = i+1
        break
    dic[x] = i+1
print(n)
for k in range(2, n+1):
    print((modCom(n+1, k) - modCom(fi+n-si, k-1)) % mod)
print(1)

Buggy python submission (verdict: Time Limit Exceeded):
N, mod = 10**5+2, 10**9+7
fac = [1] + [None] * N
for i in range(1, N+1):
    fac[i] = i * fac[i-1] % mod
facInv = [1] + [None] * N
for i in range(1, N+1):
    facInv[i] = pow(fac[i], mod-2, mod)

def modCom(n, k):
    if n < k: return 0
    return fac[n] * facInv[k] * facInv[n-k] % mod

n = int(input())
a = list(map(int, input().split()))
for x in range(1, n+1):
    if a.count(x) == 2: break
fi, si = [i+1 for i in range(n+1) if a[i] == x]
print(n)
for k in range(2, n+1):
    print(modCom(n+1, k) - modCom(fi+n-si, k-1))
print(1)


Fixed submission:
from collections import defaultdict
import sys
input = sys.stdin.readline
N, mod = 10**5+1, 10**9+7
fac = [1, 1] + [None] * N
inv = [0, 1] + [None] * N
facInv = [1, 1] + [None] * N
for i in range(2, N+1):
    fac[i] = i*fac[i-1]%mod
    inv[i] = mod-(inv[mod%i]*(mod//i))%mod
    facInv[i] = facInv[i-1]*inv[i]%mod
def modCom(n, k):
    return 0 if n < k else fac[n] * facInv[k] * facInv[n-k] % mod
n = int(input())
a = list(map(int, input().split()))
dic = defaultdict(int)
for i, x in enumerate(a):
    if dic[x] > 0:
        fi = dic[x]
        si = i+1
        break
    dic[x] = i+1
print(n)
for k in range(2, n+1):
    print((modCom(n+1, k) - modCom(fi+n-si, k-1)) % mod)
print(1)

Buggy python submission (verdict: Time Limit Exceeded):
N, mod = 10**5+2, 10**9+7
fac = [1] + [None] * N
for i in range(1, N+1):
    fac[i] = i * fac[i-1] % mod
facInv = [1] + [None] * N
for i in range(1, N+1):
    facInv[i] = pow(fac[i], mod-2, mod)

def modCom(n, k):
    if n < k: return 0
    return fac[n] * facInv[k] * facInv[n-k] % mod

n = int(input())
a = list(map(int, input().split()))
for x in range(1, n+1):
    if a.count(x) == 2: break
fi, si = [i+1 for i in range(n+1) if a[i] == x]
print(n)
for k in range(2, n+1):
    print(modCom(n+1, k) - modCom(fi+n-si, k-1))
print(1)


Fixed submission:
from collections import defaultdict
import sys
input = sys.stdin.readline
N, mod = 10**5+1, 10**9+7
fac = [1, 1] + [None] * N
inv = [0, 1] + [None] * N
facInv = [1, 1] + [None] * N
for i in range(2, N+1):
    fac[i] = i*fac[i-1]%mod
    inv[i] = mod-(inv[mod%i]*(mod//i))%mod
    facInv[i] = facInv[i-1]*inv[i]%mod
def modCom(n, k):
    return 0 if n < k else fac[n] * facInv[k] * facInv[n-k] % mod
n = int(input())
a = list(map(int, input().split()))
dic = defaultdict(int)
for i, x in enumerate(a):
    if dic[x] > 0:
        fi = dic[x]
        si = i+1
        break
    dic[x] = i+1
print(n)
for k in range(2, n+1):
    print((modCom(n+1, k) - modCom(fi+n-si, k-1)) % mod)
print(1)