criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;
import static java.lang.Integer.*;

import java.math.BigInteger;
//import static java.lang.Long.*;
//import static java.lang.Math.*;

public class Main2 {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(System.in);
		int n = parseInt(sc.next());
		int k = parseInt(sc.next());
		sc.close();
		BigInteger[] fa = new BigInteger[n+1];
		fa[0] = new BigInteger("1");
		fa[1] = new BigInteger("1");
		for(i=2;i<=n;i++) {
			fa[i] = fa[i-1].multiply(new BigInteger(String.valueOf(i)));
//			if(fa[i] > 1000000007) fa[i] %= 1000000007;
//			System.out.printf("%d %d%n",i,fa[i]);
		}
		long ans = n-k+1;
		System.out.println(ans);
		BigInteger nn = fa[n-k+1].multiply(fa[k-1]);
//		System.out.println(nn);
		BigInteger ans2;
		BigInteger mod = new BigInteger("1000000007");
//		long kake = ans;
//		long kake2 = 1;
		for(i=2;i<=k;i++) {
//			System.out.printf("%d %d %d %d%n", fa[i], fa[n-k+1-i], fa[i-1], fa[k-1-(i-1)]);
			ans2 = nn.divide(fa[i]).divide(fa[n-k+1-i]).divide(fa[i-1]).divide(fa[k-1-(i-1)]);
//			System.out.printf("%d %d%n", ((n-k+1)-i+1), i);
//			System.out.printf("%d %d%n", k+1-i, i-1);
//			kake *= ((n-k+1)-i+1);
//			kake /= i;
//			kake2 *= k+1-i;
//			kake2 /= i-1;
//			if(kake > 1000000007) kake %= 1000000007;
//			if(kake2 > 1000000007) kake2 %= 1000000007;
//			System.out.printf("%d %d%n", kake, kake2);
//			ans = kake  * kake2;
//			ans *= ((n-k+1)-i+1) * (k+1-i); 
//			ans /= i * (i-1); 
			if(ans2.compareTo(mod) > 0) ans2 = ans2.mod(mod);
			System.out.println(ans2);
		}
	}
}


Compiler output:
Main.java:8: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N,K;
  cin >> N >> K;
  int mod = 1000000007;
  vector<vector<int>> v(N+1,vector<int>(N+1,0));
  for(int i=0;i<=N;i++){
    v[i][0] = 1;
  }
   for(int i=1;i<=N;i++){
     for(int j=1;j<=i;j++){
       v[i][j] = v[i-1][j-1]+v[i-1][j];
       v[i][j] %= mod;
     }
   }
  
  for(int i=1;i<=K;i++){
    int ans = (v[K-1][i-1]*v[n-K+1][i])%mod;
    
    cout << ans<< endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:30: error: 'n' was not declared in this scope
   20 |     int ans = (v[K-1][i-1]*v[n-K+1][i])%mod;
      |                              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
const mod = 1000000007;
int main()
{
  int n,K;
  cin >> n >> K;
  int N = 2005;
  vector<vector<int>> v(N,vector<int>(N,0));
  for(int i=0;i<=N;i++){
    v[i][0] = 1;
  }
   for(int i=1;i<=N;i++){
     for(int j=1;j<=i;j++){
       v[i][j] = v[i-1][j-1]+v[i-1][j];
       v[i][j] %= mod;
     }
   }
  
  for(int i=1;i<=K;i++){
    int ans = (v[K-1][i-1]*v[n-K+1][i])%mod;
    
    cout << ans<< endl;
  }
}


Compiler output:
a.cc:3:7: error: 'mod' does not name a type
    3 | const mod = 1000000007;
      |       ^~~
a.cc: In function 'int main()':
a.cc:16:19: error: 'mod' was not declared in this scope; did you mean 'modf'?
   16 |        v[i][j] %= mod;
      |                   ^~~
      |                   modf
a.cc:21:41: error: 'mod' was not declared in this scope; did you mean 'modf'?
   21 |     int ans = (v[K-1][i-1]*v[n-K+1][i])%mod;
      |                                         ^~~
      |                                         modf
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,K;
  cin >> n >> K;
  int N = 2005;
  int mod = 1000000007;
  vector<vector<int>> v(N,vector<int>(N,0));
  for(int i=0;i<=N;i++){
    v[i][0] = 1;
  }
   for(int i=1;i<=N;i++){
     for(int j=1;j<=i;j++){
       v[i][j] = v[i-1][j-1]+v[i-1][j]
       v[i][j] %= mod;
     }
   }
  
  for(int i=1;i<=K;i++){
    int ans = (v[K-1][i-1]*v[n-K+1][i])%mod;
    
    cout << ans<< endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:39: error: expected ';' before 'v'
   15 |        v[i][j] = v[i-1][j-1]+v[i-1][j]
      |                                       ^
      |                                       ;
   16 |        v[i][j] %= mod;
      |        ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,K;
  cin >> n >> K;
  int N = 2005;
  int mod = 1000000007;
  vector<vector<int>> v(N,vector<int>(N,0));
  for(int i=0;i<N;i++){
    v[i][0] = 1;
  }
   for(int i=1;i<N;i++){
     for(int j=1;j<=i;j++){
       v[i][j] = (v[i-1][j-1]+v[i-1][j]) % mod;
     }
   }
  
 for(lint i=1;i<=K;i++)
		cout << (comb[N-K+1][i]*comb[K-1][i-1])%mod << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:6: error: 'lint' was not declared in this scope; did you mean 'uint'?
   19 |  for(lint i=1;i<=K;i++)
      |      ^~~~
      |      uint
a.cc:19:15: error: 'i' was not declared in this scope
   19 |  for(lint i=1;i<=K;i++)
      |               ^
a.cc:20:26: error: 'comb' was not declared in this scope; did you mean 'wctomb'?
   20 |                 cout << (comb[N-K+1][i]*comb[K-1][i-1])%mod << endl;
      |                          ^~~~
      |                          wctomb
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD=1000000007;
const int N_MAX=2010;
ll fact[N_MAX],factinv[N_MAX];

/*階乗
ll fact(int n){
  if(n==0){return 1;}
  return fact((n-1)%MOD)*n%MOD;
}
毎回の出力が一つだけならメモ化しなくていいので先に階乗を計算する
*/

//繰り返し2乗法
ll power(ll a,ll b){
  ll res=1;
  while(b>0){
    if(b&1) res=res*a%MOD;
    a=a*a%MOD;
		b>>=1;
	}
  return res;
}
//二項係数
ll comb(ll n, ll r){
	ll res;
	if(n<0||r<0||n<r){res=0;}
	else{res=(fact[n]*factinv[r])%MOD*factinv[n-r]%MOD;}
	return res;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,k;
	cin>>n>>k;//Binの分子
	fact[0]=1;
        // 階乗の計算
	for(int i=1;i<=n;i++){fact[i]=fact[i-1]*i%MOD;}
	fact_inv[n]=power(fact[n], MOD-2);
        // 逆元の計算
	for(int i=n-1; i>=0; --i){factinv[i]=factinv[i+1]*(i+1)%MOD;}
  for(int i=1;i<=k;i++){
    cout<<comb(n-k+1,i)*comb(k-1,i-1)%MOD<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'fact_inv' was not declared in this scope; did you mean 'factinv'?
   42 |         fact_inv[n]=power(fact[n], MOD-2);
      |         ^~~~~~~~
      |         factinv
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD=1000000007;
const int N_MAX=2010;
ll fact[N_MAX],factinv[N_MAX];

/*階乗
ll fact(int n){
  if(n==0){return 1;}
  return fact((n-1)%MOD)*n%MOD;
}
毎回の出力が一つだけならメモ化しなくていいので先に階乗を計算する
*/

//繰り返し2乗法
ll power(ll a,ll b){
  ll res=1;
  while(b>0){
    if(b&1) res=res*a%MOD;
    a=a*a%MOD;
		b>>=1;
	}
  return res;
}
//二項係数
ll comb(ll n, ll r){
	ll res;
	if(n<0||r<0||n<r){res=0;}
	else{res=(fact[n]*fact_inv[r])%MOD*factinv[n-r]%MOD;}
	return res;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,k;
	cin>>n>>k;//Binの分子
	fact[0]=1;
        // 階乗の計算
	for(int i=1;i<=n;i++){fact[i]=fact[i-1]*i%MOD;}
	fact_inv[n]=power(fact[n], MOD-2);
        // 逆元の計算
	for(int i=n-1; i>=0; --i){factinv[i]=factinv[i+1]*(i+1)%MOD;}
  for(int i=1;i<=k;i++){
    cout<<comb(n-k+1,i)*comb(k-1,i-1)%MOD<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'll comb(ll, ll)':
a.cc:30:27: error: 'fact_inv' was not declared in this scope; did you mean 'factinv'?
   30 |         else{res=(fact[n]*fact_inv[r])%MOD*factinv[n-r]%MOD;}
      |                           ^~~~~~~~
      |                           factinv
a.cc: In function 'int main()':
a.cc:42:9: error: 'fact_inv' was not declared in this scope; did you mean 'factinv'?
   42 |         fact_inv[n]=power(fact[n], MOD-2);
      |         ^~~~~~~~
      |         factinv
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
using in = int64_t ;
in nCr(in n, in r) {
  if ( r * 2 > n ) r = n - r;
  in dividend = 1;
  in divisor  = 1;
  for (in i = 1; i <= r; ++i ) {
    dividend *= (n-i+1);
    divisor  *= i;
  }
  return dividend / divisor;
}


int main(){
  int N,K;
  cin >>N>>K;
  int64_t bou,aka,ans,waru;
  
for(int i =1;i<=K;i++){

  bou = nCr(k-1,i);
    //k-1Ci
  aka = nCr(n-k-1,i-1);
    //n-k-1Ci-1
  waru = 1000000007;
  ans = (bou * aka)%waru;
  cout <<ans << endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: 'k' was not declared in this scope
   24 |   bou = nCr(k-1,i);
      |             ^
a.cc:26:13: error: 'n' was not declared in this scope
   26 |   aka = nCr(n-k-1,i-1);
      |             ^
Language: C++

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

long inverse(long n, long mod)
{
    long m = mod - 2;
    long ans = 1;
    long prod = n;
    while (m != 0)
    {
        if (m & 1)
        {
            ans *= prod;
            ans %= mod;
        }
        m >>= 1;
        prod *= prod;
        prod %= mod;
    }
    return ans;
}

long C(long n, long m)
{
    long N = 1;
    for (int i = n - m + 1; i <= n; i++)
    {
        N *= i;
        N %= s;
    }
    long M = 1;
    for (int i = 1; i <= m; i++)
    {
        M *= i;
        M %= s;
    }
    return (N * inverse(M, s)) % s;
}

int main()
{
    long K, N;
    cin >> N >> K;
    for (int i = 1; i <= K; i++)
    {
        if (N - K + 1 >= i)
            cout << (C(K - 1, i - 1) * C(N - K + 1, i)) % s << endl;
        else
            cout << 0 << endl;
    }
}　

Compiler output:
a.cc:52:2: error: extended character 　 is not valid in an identifier
   52 | }　
      |  ^
a.cc:52:2: error: '\U00003000' does not name a type
   52 | }　
      |  ^~
Language: C++

#include <iostream>
#define MOD 1000000007
typedef long long ll;

using namespace std;

// n^(exponent)を計算 O(logN)
ll pow(ll n, ll exponent) {
    ll pow = 1;
    while(exponent > 0) {
        if((exponent & 1) == 1) {
            pow *= n;
        }
        n *= n;
        
        // 桁をずらす
        exponent >>= 1;
    }
    return pow;
}

// n^(exponent) を mod で割った余りを計算 O(logN)
ll mod_pow(ll n, ll exponent, ll mod) {
    ll pow = 1;
    while(exponent > 0) {
        if((exponent & 1) == 1) {
            pow *= n;
            pow %= mod;
        }
        n *= n;
        n %= mod;
        
        // 桁をずらす
        exponent >>= 1;
    }
    return pow;
}

// n! を計算　O(N)
ll factorial(ll n) {
    ll factorial = 1;
    for(ll i = 1; i <= n; i++) {
        factorial *= i;
    }
    return factorial;
}

// n! を mod で割った余りを計算　O(N)
ll mod_factorial(ll n, ll mod) {
    ll factorial = 1;
    for(ll i = 1; i <= n; i++) {
        factorial *= i;
        factorial %= mod;
    }
    return factorial;
}

// xCn を計算
ll conbination(ll x, ll n) {
    return factorial(x) / (factorial(n) * factorial(x - n));
}

// xCn を　mod で割った余りを計算
ll mod_conbination(ll x, ll n, ll mod) {
    ll conb = mod_factorial(x, mod);
    
    // 逆元を求める(フェールマーの小定理を参照)
    ll reverse_n *= mod_pow(mod_factorial(n, mod), mod - 2, mod);
    ll reverse_difference *= mod_pow(mod_factorial(x - n, mod), mod - 2, mod);
    
    return (((conb * reverse_n) % mod) * reverse_difference) % mod;
}

int main() {
    ll n, k;
    cin >> n >> k;
    
    for(int i = 1; i <= k; i++) {
        if(i - 1 <= n - k) {
            cout << (mod_conbination(k - 1, i - 1, MOD) * mod_conbination(n - k + 1, i, MOD)) % MOD << endl;
        }
        else {
            cout << 0 << endl;
        }
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'll mod_conbination(ll, ll, ll)':
a.cc:68:18: error: expected initializer before '*=' token
   68 |     ll reverse_n *= mod_pow(mod_factorial(n, mod), mod - 2, mod);
      |                  ^~
a.cc:69:27: error: expected initializer before '*=' token
   69 |     ll reverse_difference *= mod_pow(mod_factorial(x - n, mod), mod - 2, mod);
      |                           ^~
a.cc:71:22: error: 'reverse_n' was not declared in this scope
   71 |     return (((conb * reverse_n) % mod) * reverse_difference) % mod;
      |                      ^~~~~~~~~
a.cc:71:42: error: 'reverse_difference' was not declared in this scope
   71 |     return (((conb * reverse_n) % mod) * reverse_difference) % mod;
      |                                          ^~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;
#define LL long long
#define MOD 1000000007

LL N, K;
LL C[2002][2002];

int main() {
    cin >> N >> K;
    
    for(int i=1; i<2002; i++){
        C[i][0] = 1;
        for(int j=1; j<i; j++){
            C[i][j] = 
        }
    }
    
    for(int i=0; i<min(N - K + 1, K); i++){
        LL a, b, c, d;
        a = K - 1;
        b = i;
        c = N - K + 1;
        d = i + 1;
        LL t1, t2, t3, t4;
        t1 = t2 = t3 = t4 = 1;
    
        for(int j=0; j<i; j++){
            t1*=a; a--;
            t2*=b; b--;
        }
        for(int j=0; j<i+1; j++){
            t3 *= c; c--;
            t4 *= d; d--;
        }
    
        LL ans = 1;
        ans = t1 / t2; ans %= MOD;
        ans *= t3 / t4; ans %= MOD;
        cout << ans << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: expected primary-expression before '}' token
   17 |         }
      |         ^
Language: C++

def fact(n)
  @facts ||= [1]
  (@facts.size).upto(n){|i| @facts << @facts[-1]*i % MOD}
  return @facts[n]
end
 
def modpow(x,n)
  ret = 1
  while n > 0
    ret = (ret * x) % MOD if n&1 == 1
    x = (x*x) % MOD
    n >>= 1
  end
  return ret
end
 
def modinv(x)
  return modpow(x,MOD-2)
end
 
def combin(n,k)
  return (((fact(n) * modinv(fact(n-k))) % MOD) * modinv(fact(k))) % MOD
end
 
MOD = 10**9+7
n,k = gets.split.map(&:to_i)
 
if n==k
  p 1
  (k-1).times do 
    p 0
  end
else
  1.upto(k) do |i|
    
    t = 0
    t += combin(n-k-1,i) if n-k-1 >= i
    t += combin(n-k-1,i-1) * 2 if n-k-1 >= i-1
    t += combin(n-k-1,i-2) if n-k-1 >= i-2 && i-2 >= 0
    t %= MOD
    
    p (combin(k-1,i-1) * t) % MOD
  end
end

Compiler output:
a.cc:2:3: error: stray '@' in program
    2 |   @facts ||= [1]
      |   ^
a.cc:3:4: error: stray '@' in program
    3 |   (@facts.size).upto(n){|i| @facts << @facts[-1]*i % MOD}
      |    ^
a.cc:3:29: error: stray '@' in program
    3 |   (@facts.size).upto(n){|i| @facts << @facts[-1]*i % MOD}
      |                             ^
a.cc:3:39: error: stray '@' in program
    3 |   (@facts.size).upto(n){|i| @facts << @facts[-1]*i % MOD}
      |                                       ^
a.cc:4:10: error: stray '@' in program
    4 |   return @facts[n]
      |          ^
a.cc:1:1: error: 'def' does not name a type
    1 | def fact(n)
      | ^~~
a.cc:4:3: error: expected unqualified-id before 'return'
    4 |   return @facts[n]
      |   ^~~~~~
Language: C++

n, k = map(int, input().split())
 
from math import factorial
div = 10**9 + 7
 
def cmb(n, r):
  if n == 0 or r == 0:
    return 1
  if n < r:
    return 0
  a = b = 1
  r = min(n-r, r)
  for i in range(n-r+1,n+1):
    a*=i
  for i in range(1,r+1):
    b*=i
    
  return a//b
  
for i in range(1, k+1):
  print(cmb(k-1, i-1)*cmb(n-k+1, i)%div)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, k = map(int, input().split())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int llint;
typedef long long ll;
typedef long int lint;
typedef vector<char> vchar;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef vector<vector<int>> vvint;
typedef vector<vector<char>> vvchar;
#define vsort(v) sort((v).begin(), (v).end())
#define vrsort(v) sort((v).rbegin(), (v).rend())
#define vreverse(v) reverse((v).begin(), (v).end())
#define pb(a) push_back(a)
#define INF 2000000009
#define MOD 1000000007
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  //input
  ll n,k,i;cin>>n>>k;
  //caricurate
  if(n==k){
  for(i=1;i<k+1;i++){cout<<((i==1)?1:0)<<endl;}
    return 0;
  }
  vll r(n+1);r[1]=1;r[0]=1;
  for(i=2;i<n+1;i++){r[i]=r[i-1]*i;r[i]%=MOD;}
  cout<<n-k+1<<endl;ll g;
  if(k-1>n-k){g=n-k+1;}
  else{g=k+1}
  for(i=2;i<g;i++){
    ll h=1;
    h*=r[n-k+1]%MOD;//3!
    h*=r[k-1]%MOD;//2!
    h*=modinv(r[i], MOD)%MOD;//2!
    h%=MOD;
    h*=modinv(r[n-k-i+1], MOD)%MOD;//2!
    h%=MOD;
    h*=modinv(r[k-i], MOD)%MOD;//0!
    h%=MOD;
    h*=modinv(r[i-1], MOD)%MOD;//2!
    cout<<h%MOD<<endl;
  }
  while(i<k+1){cout<<0<<endl;i++;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:13: error: expected ';' before '}' token
   43 |   else{g=k+1}
      |             ^
      |             ;
Language: C++

#include<iostream>

using namespace std;

int conbi(int n, int r) {
	if (r == 0 || r == n) return 1;
	else if (r == 1) return n;

	return conbi(n - 1, r) + conbi(n - 1, r - 1);
}

//ボールの隙間を考える
int main() {
	int n, k;
	cin >> n >> k;
	for (int i = 1; i <= k; i++) {
		cout << conbi(n - k + 1, i) * conbi(k - 1, i - 1) % ((int)pow(10, 9) + 7) << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:75: error: 'pow' was not declared in this scope
   17 |                 cout << conbi(n - k + 1, i) * conbi(k - 1, i - 1) % ((int)pow(10, 9) + 7) << endl;
      |                                                                           ^~~
Language: C

#include <cstdio>
using namespace std;
long long v[2005][2005];
const int mod=1e9+7;
int main() {
    long long n,k;
    scanf("%lld%lld",&n,&k);
    v[0][0]=1;
    for(int i=1;i<=n;i++){
        v[i][0]=1;
        for(int j=1;j<=i;j++)
            v[i][j]=(v[i-1][j-1]+v[i-1][j])%mod;
    }
    for(int i=1;i<=k;i++)
        printf("%lld\n",v[n-k+1][i]*v[k-1][i-1]%mod);
    //std::cout << "Hello, World!" << std::endl;
    return 0;
}

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C

#include <cstdio>
using namespace std;
long long v[2005][2005];
const int mod=1e9+7;
int main() {
    long long n,k;
    scanf("%lld%lld",&n,&k);
    v[0][0]=1;
    for(int i=1;i<=n;i++){
        v[i][0]=1;
        for(int j=1;j<=i;j++)
            v[i][j]=(v[i-1][j-1]+v[i-1][j])%mod;
    }
    for(int i=1;i<=k;i++)
        printf("%lld\n",v[n-k+1][i]*v[k-1][i-1]%mod);
    return 0;
}

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C

#include <cstdio>
using namespace std;
long long v[2005][2005];
const int mod=1e9+7;
int main() {
    long long n,k;
    scanf("%lld%lld",&n,&k);
    v[0][0]=1;
    for(int i=1;i<=n;i++){
        v[i][0]=1;
        for(int j=1;j<=i;j++)
            v[i][j]=(v[i-1][j-1]+v[i-1][j])%mod;
    }
    for(int i=1;i<=k;i++)
        printf("%lld\n",v[n-k+1][i]*v[k-1][i-1]%mod);    
    return 0;
}


Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
 
using namespace std;
 
#define MAX 2010
#define MOD 1000000007
 
long long bin[MAX][MAX] = {0};
 
void pascal_trianlge() {
	bin[0][0] = 1;
	for (int i = 1; i < MAX; ++i) {
		bin[i][0] = bin[i][i] = 1;
		for (int j = 1; j < i; ++j) {
			bin[i][j] = (bin[i-1][j] + bin[i-1][j-1]) % MOD;
		}
	}
}
 
int main() {
	int n, k;
	cin >> n >> k;
	pascal_trianlge();
 
	for (int i = 1; i < k + 1; ++i) {
			cout << (bin[n - k + 1][i] * bin[k - 1][k - i]) % MOD  << endl;
	}
 
	return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

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 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(){
	int k, n;
	cin >> n >> k;
	ComInit();
	//赤玉に青の仕切りを入れる。
	//青ボールのグループ分割方法 i個のグループ
	for (int i = 1; i <= k;++i){
		if(i>n-k+1){
			cout << 0 << endl;
		}
		else
		{
			cout << comb(n - k + 1, i) * comb(k - 1, i - 1) % MOD << endl;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: 'ComInit' was not declared in this scope; did you mean 'COMinit'?
   36 |         ComInit();
      |         ^~~~~~~
      |         COMinit
a.cc:45:33: error: 'comb' was not declared in this scope; did you mean 'wctomb'?
   45 |                         cout << comb(n - k + 1, i) * comb(k - 1, i - 1) % MOD << endl;
      |                                 ^~~~
      |                                 wctomb
Language: C++

def mod_inv(value):
    b = mod
    u = 1
    v = 0
    while b:
        t = value // b
        value -= t * b
        b, value = value, b
        u -= t * v
        v, u = u, v
    u %= mod
    if u < 0:
        u += mod
    return u

def calcFact():
    fact[0] = 1
    fact_inv[0] = 1
    for i in range(1, 2010):
        fact[i] = i * fact[i - 1]
        fact[i] %= mod
        fact_inv[i] = mod_inv(fact[i])
    return

def comb(n, r):
    if r == 0:
        return 1
    return fact[n] * fact_inv[r] % mod * fact_inv[n - r] % mod

fact = [0 for i in range(2020)]
fact_inv = [0 for i in range(2020)]

mod = 1000000007

N, K = map(int, input().split())
calcFact()

for i in range(1, K + 1):
    if N - K + 1 < i:
        print(0)
        continue
    ans = comb(K - 1, i - 1) * comb(N - K + 1, i) % mod
    print(ans)
    


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def mod_inv(value):
      | ^~~
Language: C++

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


int convination(int n, int m){
	int a = 1, b = 1;
	for(int i = 1; i <= m; i++){
		a *= n - i + 1;
		b *= i;
	}
	
	return a / b;
}

int power10(int X){
	int R=10;
	for( int i = 0; i < X; i++ ){
		R *= 10;
	}
	return R;
}


int main(){
	int N, K;
	cin >> N >> K;
	//(N - K)C(i)を計算
	int div = power10(9) + 7;
	
	for(int i = 1; i < = K; i++){
		int ans = convination(N - K, i) % div;
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:28: error: expected primary-expression before '=' token
   30 |         for(int i = 1; i < = K; i++){
      |                            ^
Language: C

#include <stdio.h>
#define Mod 1000000007

long long pow_mod(long long a, long long k, long long M){
  if(k == 1) return a % M;
  if(k == 0) return 1;
  long long temp = pow_mod(a, k/2, M);
  if(k % 2 == 1) return ((a*temp%M) *temp)%M;
  return (temp*temp)%M;
}

int
main(int argc, char *argv[])
{
  long long k, n;
  scanf("%lld %lld", &n, &k);

  n = n - k;
  long long int a = n + 1; long long b;
  for(long long i = 1; i <= k; i++){
    printf("%lld\n", a);
    if(i == k) break;
    b = (k - i)*a%Mod;
    b = (n - i + 1)*b%Mod;
    b = b*pow_mod(i*(i+1), Mod - 2, Mod)%Mod
    a = b;
  }

  return 0;

}


Compiler output:
main.c: In function 'main':
main.c:26:5: error: expected ';' before 'a'
   26 |     a = b;
      |     ^
Language: C++

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

ll comb(int a, int b) {
  if(b==0 || a < b) {
  	return 1;
  }
	ll ans = 1;
  	for (int i = a; i > a - b; i--) {
    	ans *= i;
    }
  	for (int i = 1; i < b + 1; i++) {
    	ans /= i;
    }
  return ans;
}

int main() {
  int  n, k;
  cin >> n >> k;
  ll a = 1000000007;
  
  for (ll i = 1; i <= k; i++) {
	cout << comb(n-k+1,i)*comb(k-1,i-1) % a << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:26:4: error: expected '}' at end of input
   26 |   }
      |    ^
a.cc:19:12: note: to match this '{'
   19 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
int main()
{
    int N,K;
    cin >> N >> K;
    for(int i=1; i<=K; i++)
    {
        cout << conbination(N - K + 1, i) << endl;
    }
    return 0;
}

int conbination(int m,int n)
{
    return kaijyo(m)/(kaijyo(m-n)*kaijyo(n));
}

int kaijyo(int n)
{
    int a=1;
    for(int i=1; i<=n; i++)
    {
        a*=i;
    }
    return a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'conbination' was not declared in this scope
   11 |         cout << conbination(N - K + 1, i) << endl;
      |                 ^~~~~~~~~~~
a.cc: In function 'int conbination(int, int)':
a.cc:18:12: error: 'kaijyo' was not declared in this scope
   18 |     return kaijyo(m)/(kaijyo(m-n)*kaijyo(n));
      |            ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
int main()
{
    int N,K;
    cin >> N >> K;
    for(int i=1; i<=K; i++)
    {
        cout << conbination(N - K + 1, i) << endl;
    }
    return 0;
}

int conbination(int m,int n)
{
    return kaijyo(m)/(kaijo(m-n)*kaijo(n));
}

int kaijyo(int n)
{
    int a=1;
    for(int i=1; i<=n; i++)
    {
        a*=i;
    }
    return a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'conbination' was not declared in this scope
   11 |         cout << conbination(N - K + 1, i) << endl;
      |                 ^~~~~~~~~~~
a.cc: In function 'int conbination(int, int)':
a.cc:18:12: error: 'kaijyo' was not declared in this scope
   18 |     return kaijyo(m)/(kaijo(m-n)*kaijo(n));
      |            ^~~~~~
a.cc:18:23: error: 'kaijo' was not declared in this scope
   18 |     return kaijyo(m)/(kaijo(m-n)*kaijo(n));
      |                       ^~~~~
Language: C++


#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
int main()
{
    int N,K;
    cin >> N >> K;
    for(int i=1; i<=K; i++)
    {
        cout << conbination(N - K + 1, i) << endl;
    }
    return 0;
}

int conbination(int m,int n)
{
    return kaijyo(m)/(kaijo(m-n)*kaijo(n))
}

int kaijyo(int n)
{
    int a=1;
    for(int i=1; i<=n; i++)
    {
        a*=i;
    }
    return a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'conbination' was not declared in this scope
   12 |         cout << conbination(N - K + 1, i) << endl;
      |                 ^~~~~~~~~~~
a.cc: In function 'int conbination(int, int)':
a.cc:19:12: error: 'kaijyo' was not declared in this scope
   19 |     return kaijyo(m)/(kaijo(m-n)*kaijo(n))
      |            ^~~~~~
a.cc:19:23: error: 'kaijo' was not declared in this scope
   19 |     return kaijyo(m)/(kaijo(m-n)*kaijo(n))
      |                       ^~~~~
a.cc:19:43: error: expected ';' before '}' token
   19 |     return kaijyo(m)/(kaijo(m-n)*kaijo(n))
      |                                           ^
      |                                           ;
   20 | }
      | ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
long long mod = 1000000007;
int main(){
  int N, K;cin>>N>>K;
  int l = N-K+1;
  cout<<l<<endl;
  long long C[N+1], c[N+1];
  C[1] = l;
  c[1] = 1;
  for(int i=2;i<=K;i++){
    //ans[i] = lCi *  (K-1)C(i-1);
    C[i] = C[i-1] /i *(l-i+1);
    C[i] %= mod;
    c[i] = c[i-1]/(i-1)*=(K-i+1);
    c[i] %= mod;
    long long ans = C[i] * c[i];
    cout << ans % mod <<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: lvalue required as left operand of assignment
   16 |     c[i] = c[i-1]/(i-1)*=(K-i+1);
      |            ~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <bitset>
#include<vector>
using namespace std;
typedef long long ll;
#define rep(i,k) for(i=0;i<k;i++)
ll n, k, b, c, d, e = 0, f = 0, i, j, g=1000000007, m;


int main() {
	cin >> n >> k;
	m = n - k + 1;
	b = m;
	j = 1;
	cout << m<<"\n";
	for (i = 2;i <= k; i++){
		m = (m * (b - i+1) / i) % g;
		j = (j * (k - i + 1) / (i - 1)) % g;
		
		cout << (m * j)%g<<"\n";
	}

	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:27:18: error: expected '}' at end of input
   27 |         return 0;
      |                  ^
a.cc:14:12: note: to match this '{'
   14 | int main() {
      |            ^
Language: C++

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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int mod = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

#define MOD 1000000007

/*
int combination(int dan, int ban){
  //pascal's triangle
  if(ban == 1 || ban == dan)
    return 1;  
  
  //c[dan][ban] = (dan-1)C(ban-1)
  return (combination(dan-1, ban-1) \
    + combination(dan-1, ban)) % MOD;
  
}
*/

ll combination(int n, int k){
  if(b < 0)
    return 0;
  ll ans = 1;
  
  for(int i = 0; i < k; i++){
    ans *= n - i;
    ans /= i + 1;
  }
  return ans%MOD;
}

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

  int n, k;
  cin >> n >> k;
  
  //select i spaces between red(n-k) to set blue.
  //(n-k+1)C(i)
  
  //set k blues for each space(i) at least 1 ball.
  //(k-1)C(i-1)
  for(int i = 1; i <= k; i++){
    ll answer = combination(n-k+1, i) \
      * combination(k-1, i-1) % MOD;
    cout << answer << "\n";
  }
  
}



Compiler output:
a.cc: In function 'll combination(int, int)':
a.cc:52:6: error: 'b' was not declared in this scope
   52 |   if(b < 0)
      |      ^
Language: Java

import java.util.*;
import java.lang.*;
import java.io.*;

public class Main{
public static void main (String[] args){
	Scanner sc = new Scanner(System.in);
	long n = Long.parseLong(sc.next());
	long k = Long.parseLong(sc.next());
	long a = 0;
	long b = 0;
	
	for(int i = 1;i <= k; i++){
		if(i <= n - k +1){
			a = calcCom(k-1,i-1);
			b = calcCom(n-k+1,i);
			System.out.println((a*b)%1000000007l);
		}else{
			System.out.println("0");
		}	
	}
}
public static long calcComx(long n, long r){
	long num = 1;
	for(int i = 1; i <= r; i++){
		num = num * (n - i + 1) / i;
		num = num % 1000000007l;
	}
	return num;
}
}


Compiler output:
Main.java:15: error: cannot find symbol
			a = calcCom(k-1,i-1);
			    ^
  symbol:   method calcCom(long,int)
  location: class Main
Main.java:16: error: cannot find symbol
			b = calcCom(n-k+1,i);
			    ^
  symbol:   method calcCom(long,int)
  location: class Main
2 errors
Language: C++

#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;
 
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;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void COMuse() {
    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;
    }
}

#define COMuse() comuse
 
ll combi(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;
}
 


 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  comuse;
  ll n,k;
  	ci(n>>k)
    FOR(i,1,k+1){
      ll ans=1;
      ans*=combi(n-k+1,i);
      ans*=combi(k-1,i-1);
      ans%=1000000007;
   co(ans)
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:114:3: error: 'comuse' was not declared in this scope; did you mean 'COMuse'?
  114 |   comuse;
      |   ^~~~~~
      |   COMuse
Language: C++

#include <bits/stdc++.h>

#define mod 1e9 + 7;

using namespace std;
 
int main(void){
	
	long long int N, K, ans, con1, con2, con3, con4;
	
	cin >> N >> K;
	
	for(int i=1; i<=K; i++){
		con1 = 1;
		con2 = 1;
		con3 = 1;
		con4 = 1;
		if(N == 1){
			cout << 1 << endl;
			continue;
		}
		if(N == K){
			if(i == 1)
				cout << 1 << endl;
			else
				cout << 0 << endl;
			continue;
		}
		if(K == 1){
			if(i == 1)
				cout << N << endl;
			else
				cout << 0 << endl;
			continue;
		}
		for(int j=K-1; j>(K-1)-(i-1); j--){
			con1 *= j;
		}
		for(int j=N-K+1; j>N-K+1-i; j--){
			con2 *= j;
		}
		for(int j=i; j>0; j--){
			con3 *= j;
		}
		for(int j=i-1; j>0; j--){
			con4 *= j;
		}
		ans = con1 * con2;
		ans /= con3;
		ans /= con4;
		ans %= mod;
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:21: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   51 |                 ans %= mod;
      |                     ^
a.cc:51:21: note:   in evaluation of 'operator%=(long long int, double)'
Language: C++

#include<bits/stdc++.h>

#define rep(i,n) for (int i=0; i< (n); i++)
typedef std::pair<int, int> P;
typedef long long int ll;

using namespace std;

const ll MOD = 1e9+7;

int c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 2000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i + 1][j] = (c[i+1][j] + c[i][j]) % mod;
      c[i + 1][j + 1] = (c[i+1][j+1] + c[i][j]) % mod;
    }
  }
}

int comb(int n, int r) {
    return c[n][r];
}

int main(){
    int n, k;
    cin >> n >> k;
    init();
    for(int i=1; i <= k; i++) {
        ll ans = comb(n-k+1, i) * comb(k-1, i-1);
        printf("%lld\n", ans % MOD);
    }
    return 0;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:16:45: error: 'mod' was not declared in this scope; did you mean 'modf'?
   16 |       c[i + 1][j] = (c[i+1][j] + c[i][j]) % mod;
      |                                             ^~~
      |                                             modf
Language: C++

ftfeujoiguy2w
huheuhueuhuhfheu
jjhhuheruhufhuerh
bjebjjejhefejhje
jhbfueoheihiuegufeojfofeufe
egugeuufhiuehfejhe
khejhujebefuhueinwbvlofeuyfeurteqpq;a,lnfjhei
kehfjgyfhipwlewjhfgrufh
hfgugfeiuhe
jfbjebfijejepojmfedkfebjfen;ldm/.dw
lenhfbjefkefhkfehkfekfe
fejfheiuowowkdlmslbdjfehiekpew
jewjhoiuhfiuehih
yygehuiwoopqkldkf
jfehvhegiuwhoiehkewj
jwdjjhwjhjhjhewjew
hvehvdwhdbhdwgjhhejwkewhwkjhwjkwhjewhwjegeeuwiqpojkjbdj

Compiler output:
a.cc:1:1: error: 'ftfeujoiguy2w' does not name a type
    1 | ftfeujoiguy2w
      | ^~~~~~~~~~~~~
a.cc:7:37: error: 'a' does not name a type
    7 | khejhujebefuhueinwbvlofeuyfeurteqpq;a,lnfjhei
      |                                     ^
a.cc:10:29: error: 'ldm' does not name a type
   10 | jfbjebfijejepojmfedkfebjfen;ldm/.dw
      |                             ^~~
Language: Java

import java.io.InputStream;
import java.io.PrintStream;
import java.math.BigInteger;
import java.util.Scanner;

public class D {
    static final int MAX = 100100;
    InputStream in = System.in;
    PrintStream out = System.out;
    // static int dp[][] = new int[MAX][MAX];
    static final long MOD = (long)Math.pow(10,9)+7;

    public static long mod(long i) {
        return i % MOD + ((i % MOD) < 0 ? MOD : 0);
    }

    public static long mul(long m, long n) {
        return mod(m*n);
    }

    static long pow(long x, long y) {
        if (y == 0) {
            return 1;
        } else if (y == 1) {
            return x;
        } else if (y % 2 == 0) {
            long tmp = pow(x, y / 2);
            return mod(tmp * tmp);
        } else {
            long tmp = pow(x, y / 2);
            return mod(mod(tmp * tmp) * x);
        }
    }

    static long inv(long x) {
        return pow(x, MOD - 2);
    }

    static int MAX_FACT = 20100;
    static long fact[] = new long[MAX_FACT];
    static void prepareFact() {
        fact[0] = 1;
        for(int i = 1; i < MAX_FACT; i ++) {
            fact[i] = mod(fact[i - 1] * i);
        }
    }
    static long comb(int n, int r) {
        if(n < 0 || n < r) { return 0; }
        if(r == 0 || r == n) { return 1; }
        return mod(mod(fact[n] * inv(fact[r])) * inv(fact[n - r]));
    }

    public void _main(String[] args) {
        Scanner sc = new Scanner(in);
        prepareFact();
        int N = sc.nextInt();
        int K = sc.nextInt();
        for (int i=1;i<=K;i++){
            long ans = comb(N-K+1, i);
            long mul = comb(K-i+i-1, i-1);
            ans = mod(ans * mul);
            out.println(ans);
        }
    }

    public static void main(String[] args) {
        new D()._main(args);
    }
}


Compiler output:
Main.java:6: error: class D is public, should be declared in a file named D.java
public class D {
       ^
1 error
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
int const rest=1000000007;
int kaijo(int a){
  int ans;
  ans=a;
  if(a==0) return 1;
  else{
  for(int i=1;i<a;i++){
    ans=ans*i;
  }
  }
  return ans;
}
int comb(int a,int b){
  long ans;
  ans=kaijo(a);
  ans=ans/kaijo(a-b);
  ans=ans/kaijo(b);
  ans=ans%rest;
  return ans;
}

int main(){
  int n,k;
  cin>>n>>k;
  //  vector<vector<int>> combi(k,vector<int>(k));
  /*  for(int i=0;i<k;i++){
    for(int j=i;j<k;j++){
      combi[i][j]=comb(i,j);
    }}*/
  vector<int> ans(k+1);
  for(int i=1;i<k+1;i++){
    //    ans[i]=combi[n-k+1][i-1]*combi[k-1][i-1];
    ans[i]=comb(n-k+1,i)*comb(k-1,i-1);
    cout<<ans[i]<<endl;
    }
  }
  //  cout<<kaijo(n)<<endl;
  //  cout<<kaijo(k)<<endl;
  //  cout<<comb(n,k)<<endl;
  return 0;
}


Compiler output:
a.cc:45:3: error: expected unqualified-id before 'return'
   45 |   return 0;
      |   ^~~~~~
a.cc:46:1: error: expected declaration before '}' token
   46 | }
      | ^
Language: C++

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

public static long Factorial(int n) {
    if (n == 0)
        return 1L;
    return n * Factorial(n - 1);
}

int main(){
  int N,K;
  cin >> N >> K;
  for(i=1; i<=K; i++){
    
    cout >> Factorial(N-K+i)*Factorial(N+1)
  }
}

Compiler output:
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public static long Factorial(int n) {
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   for(i=1; i<=K; i++){
      |       ^
a.cc:15:13: error: 'Factorial' was not declared in this scope
   15 |     cout >> Factorial(N-K+i)*Factorial(N+1)
      |             ^~~~~~~~~
Language: C++

#include <iostream>

using namespace std;

static constexpr long long MOD = 1000000000 + 7;
static long long C[2001][2001];

static long long nCr(int n, int r) {
    if (n == r) {
	return 1;
    }
    if (r == 1) {
	return n;
    }
    if (n < r || n < 0 || r < 0) {
	return 0;
    }
    if (C[n][r] != -1) {
	return C[n][r];
    }
    return C[n][r] = (nCr(n - 1, r - 1) + nCr(n - 1, r)) % MOD;
}

int main()
{
    int N, K;
    cin >> N >> K;
    memset(C, -1, sizeof(C));
    for (int i = 1; i <= K; i++) {
	cout << (nCr(N - K + 1, i) * nCr(K - 1, i - 1)) % MOD << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'memset' was not declared in this scope
   28 |     memset(C, -1, sizeof(C));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
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-1; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)

#define INF 2e9
#define ll long long


int main(){
    ll n, k;
    ll i, j;
    cin>>n>>k;
    int N = 2002;
    int c[N][N];

    for(int i = 0; i<=n+1; i++){
        c[i][0] = 1;
        for(int j=1; j<=i; j++){
            c[i][j] = (c[i-1][j] + c[i-1]c[j-1]) % mod;
        }
    }


    ll ans = 0;
    for(i=1; i<=k; i++){
        //ans = factorial(k-1)/(factorial(i-1)*factorial(k-i)) * (factorial(n-k+1)/(factorial(i)*(factorial(n-k-i+1)))) % 1000000007;
        //ans = combination(k-1, i-1) * combination(n-k+1, i) % 1000000007;
        ans = c[k-1][i-1] * c[n-k+1][i] % mod;
        //cout<<"a"<<combination(2000, 10)<<endl;
        cout<<ans<<endl;

    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:42: error: expected ')' before 'c'
   22 |             c[i][j] = (c[i-1][j] + c[i-1]c[j-1]) % mod;
      |                       ~                  ^
      |                                          )
a.cc:22:34: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   22 |             c[i][j] = (c[i-1][j] + c[i-1]c[j-1]) % mod;
      |                       ~~~~~~~~~~~^~~~~~~~~
      |                                  |
      |                                  int*
a.cc:31:43: error: 'mod' was not declared in this scope; did you mean 'modf'?
   31 |         ans = c[k-1][i-1] * c[n-k+1][i] % mod;
      |                                           ^~~
      |                                           modf
Language: C++

// #include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
#define ed "\n";
#define tl 1000000007
// long long comb(int n, int k){
//   if (n == k || k == 0)
//     return 1;
//   else {
//     return comb(n - 1, k - 1) + comb(n - 1, k);
//   }
// }
 
void comb(vector<vector <long long int> > &v){
  for(int i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(int k = 1;k <v.size();k++){
    for(int j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]%tl+v[k-1][j]%tl);
    }
  }
}
int main(){
    cin.tie(0);
   	ios::sync_with_stdio(false);

    int n,k;
    vector<long long> v;
    cin >> n>>k; //k:青 n-k:赤 1<=i<=k:i回数
    comb(v);
    for(int i=1; i<=k; i++){
        long long point=0;
        int e= comb(k-1,i-1)
        //アルゴリズム
        // cerr <<"青分け方：" << e << endl; cerr << comb(n-k-(i-1),i) << ed;

        cout << (v[k-1][i-1]*v[n-k+1][i])%tl << ed;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:10: error: invalid initialization of reference of type 'std::vector<std::vector<long long int> >&' from expression of type 'std::vector<long long int>'
   35 |     comb(v);
      |          ^
a.cc:17:44: note: in passing argument 1 of 'void comb(std::vector<std::vector<long long int> >&)'
   17 | void comb(vector<vector <long long int> > &v){
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
a.cc:38:22: error: invalid initialization of non-const reference of type 'std::vector<std::vector<long long int> >&' from an rvalue of type 'int'
   38 |         int e= comb(k-1,i-1)
      |                     ~^~
a.cc:17:44: note: in passing argument 1 of 'void comb(std::vector<std::vector<long long int> >&)'
   17 | void comb(vector<vector <long long int> > &v){
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
Language: C++

lude <bits/stdc++.h>

using namespace std;
using llong = long long;
using ldbl = long double;
using P = pair<llong, llong>;

#define ALL(x) x.begin(), x.end()

const llong inf = 1100100100100100ll;
const llong mod = 1e9+7;

llong N, K;
vector<vector<llong> > dp;

llong solve(llong now, llong bunkatsu) {
	if (now == 0) return dp[now][bunkatsu] = bunkatsu == 0;
	if (bunkatsu == 0) return dp[now][bunkatsu] = 0;
	if (dp[now][bunkatsu] != -1) return dp[now][bunkatsu];

	return dp[now][bunkatsu] = (solve(now-1, bunkatsu) + solve(now-1, bunkatsu-1)) % mod;
}

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

	dp.resize(N+1, vector<llong>(K+2, -1));
	for (int i = 0; i <= K+1; ++i) {
		solve(N, i);
		solve(N-K, i);
	}

	for (int i = 1; i <= K; ++i) {
		llong b = dp[K][i];
		llong r = (dp[N-K][i-1] + dp[N-K][i]*2 + dp[N-K][i+1]) % mod;
		cout << b*r%mod << endl;
		// cerr << dp[K][i] << " " << dp[N-K][i-1] << " " << dp[N-K][i] << " " << dp[N-K][i+1] << endl;
		// cout << dp[K][i] * (max(0ll, dp[N-K][i-1]) + max(0ll, dp[N-K][i])*2ll + max(0ll, dp[N-K][i+1])) % mod << endl;
	}

	return 0;
}

Compiler output:
a.cc:1:1: error: 'lude' does not name a type
    1 | lude <bits/stdc++.h>
      | ^~~~
a.cc:6:11: error: 'pair' does not name a type
    6 | using P = pair<llong, llong>;
      |           ^~~~
a.cc:14:1: error: 'vector' does not name a type
   14 | vector<vector<llong> > dp;
      | ^~~~~~
a.cc: In function 'llong solve(llong, llong)':
a.cc:17:30: error: 'dp' was not declared in this scope
   17 |         if (now == 0) return dp[now][bunkatsu] = bunkatsu == 0;
      |                              ^~
a.cc:18:35: error: 'dp' was not declared in this scope
   18 |         if (bunkatsu == 0) return dp[now][bunkatsu] = 0;
      |                                   ^~
a.cc:19:13: error: 'dp' was not declared in this scope
   19 |         if (dp[now][bunkatsu] != -1) return dp[now][bunkatsu];
      |             ^~
a.cc:21:16: error: 'dp' was not declared in this scope
   21 |         return dp[now][bunkatsu] = (solve(now-1, bunkatsu) + solve(now-1, bunkatsu-1)) % mod;
      |                ^~
a.cc: In function 'int main()':
a.cc:25:9: error: 'cin' was not declared in this scope
   25 |         cin >> N >> K;
      |         ^~~
a.cc:27:9: error: 'dp' was not declared in this scope
   27 |         dp.resize(N+1, vector<llong>(K+2, -1));
      |         ^~
a.cc:27:24: error: 'vector' was not declared in this scope
   27 |         dp.resize(N+1, vector<llong>(K+2, -1));
      |                        ^~~~~~
a.cc:27:36: error: expected primary-expression before '>' token
   27 |         dp.resize(N+1, vector<llong>(K+2, -1));
      |                                    ^
a.cc:36:17: error: 'cout' was not declared in this scope
   36 |                 cout << b*r%mod << endl;
      |                 ^~~~
a.cc:36:36: error: 'endl' was not declared in this scope
   36 |                 cout << b*r%mod << endl;
      |                                    ^~~~