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

#include<stdio.h>

long combi(int,int);

int main(void){
    int N,K,;
    scanf("%d%d",&N,&K);
    for(int i=1;i<=K;i++){
        if(N+1>=2*K){
            printf("%ld\n",combi(K-1,i-1)*(N-K-i+1)%100000009)
        }else{
            printf("0\n");
        }
    }
}

long combi(int n,int r)
{
    long p=1;
    
    for(int i=1;i<=r;i++){
        p=p*(n-i+1)/i;
    }
    return p;
}

Compiler output:
main.c: In function 'main':
main.c:6:13: error: expected identifier or '(' before ';' token
    6 |     int N,K,;
      |             ^
main.c:10:63: error: expected ';' before '}' token
   10 |             printf("%ld\n",combi(K-1,i-1)*(N-K-i+1)%100000009)
      |                                                               ^
      |                                                               ;
   11 |         }else{
      |         ~
Language: C++

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

long long comb(int n, int r) {
  std::vector<std::vector<long long> > v(n + 1,std::vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v[n][r];
}

const int MAX_N = 2000;
const int MAX_M = 2000;
long long  memo[MAX_N + 1][MAX_M + 1];

long long p(long long n, long long  m)
{
    long long  ret;

    if (memo[n][m] >= 0)
        return memo[n][m];

    if(n == 0 || m == 1)
        return 1;

    ret = p(n, m - 1);
    if(n >= m)
        ret += p(n - m, m);

    return memo[n][m] = ret;
}


int main(){
  int N,K;
  cin>>N>>K;
  memset(memo, -1, sizeof(memo));
  for(long long i=1; i<=K; i++){
    cout<<((comb(N-K+1,i)%1000000007)*(comb(K-1,i-1)%1000000007))%1000000007<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:3: error: 'memset' was not declared in this scope
   47 |   memset(memo, -1, sizeof(memo));
      |   ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<unordered_map>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C

#include<stdio.h>

long combi(int,int);

int main(void){
    int N,K,p[2005];
    scanf("%d%d",&N,&K);
    for(int i=1;i<=K;i++){
        if(N+1>=2*K){
            printf("%ld\n",combi(K-1,i-1)*(N-K-i+1)%100000009)
        }else{
            printf("0\n");
        }
    }
}

long combi(int n,int r)
{
    long p=1;
    
    for(int i=1;i<=r;i++){
        p=p*(n-i+1)/i;
    }
    return p;
}

Compiler output:
main.c: In function 'main':
main.c:10:63: error: expected ';' before '}' token
   10 |             printf("%ld\n",combi(K-1,i-1)*(N-K-i+1)%100000009)
      |                                                               ^
      |                                                               ;
   11 |         }else{
      |         ~
Language: C

long combi(int,int);

int main(void){
    int N,K,p[2005];
    scanf("%d%d",&N,&K);
    for(int i=1;i<=K;i++){
        if(N+1>=2*K){
            printf("%ld\n",combi(K-1,i-1)*(N-K-i+1)%100000009)
        }else{
            printf("0\n");
        }
    }
}

long combi(int n,int r)
{
    long p=1;
    
    for(int i=1;i<=r;i++){
        p=p*(n-i+1)/i;
    }
    return p;
}

Compiler output:
main.c: In function 'main':
main.c:5:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |     scanf("%d%d",&N,&K);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | long combi(int,int);
main.c:5:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |     scanf("%d%d",&N,&K);
      |     ^~~~~
main.c:5:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:13: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 |             printf("%ld\n",combi(K-1,i-1)*(N-K-i+1)%100000009)
      |             ^~~~~~
main.c:8:13: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:13: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:8:13: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:63: error: expected ';' before '}' token
    8 |             printf("%ld\n",combi(K-1,i-1)*(N-K-i+1)%100000009)
      |                                                               ^
      |                                                               ;
    9 |         }else{
      |         ~                                                      
main.c:10:13: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   10 |             printf("0\n");
      |             ^~~~~~
main.c:10:13: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

//おまじない
#include <bits/stdc++.h>
using namespace std;
 
int main() {

  long long int n,k;
  cin>>n>>k;
  
  vector<int> kai(n+1);//nまでの階乗
  kai.at(0)=1;
  for(int i=0; i<n+1;i++){
    kai.at(i+1)=(i+1)*kai.at(i);}
    
  
  int b; 
  int c;//分配するときの個数
  int p; //置く場所の個数
  for( int i=0; i<n;i++){
    b=i+1;
    c=n-k-i;
    
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: expected '}' at end of input
   21 |     c=n-k-i;
      |             ^
a.cc:19:25: note: to match this '{'
   19 |   for( int i=0; i<n;i++){
      |                         ^
a.cc:21:13: error: expected '}' at end of input
   21 |     c=n-k-i;
      |             ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C

#include <stdio.h>
long long int m=1000000000+7;
long long int array[2001][2001];
long long int val=0;
long long int binom(long long int n,long long int k){
	if(array[n][k]==0){
		k=(k>(n-k))?(n-k):k;
		if(k==0){
			val=1;
        }else{
			val=(binom(n-1,k-1)*n/k)%m;
        }
		array[n][k]=val;
		return val;
	}else{
		return	array[n][k];
	}
}
int main(){
    long long int N,K;
    scanf("%lld %lld",&N,&K);
    long long int i;
    long long int j;
    for(i=0;i<=N;i++){
        for(j=0;j<=N;j++){
            array[i][j]=0;
        }
    }
    for(i=1;i<=K;i++){
        if(N-K+1>i){
            printf("%lld\n",(binom(N-K+1,i)*(binom(K-1,i-1)))%m);
        }else{
            printf("0\n");
        }

Compiler output:
main.c: In function 'main':
main.c:34:9: error: expected declaration or statement at end of input
   34 |         }
      |         ^
main.c:34:9: error: expected declaration or statement at end of input
Language: C++

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

constexpr int MAX = 2000;
constexpr int MOD = 1000000007;

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

// テーブルを作る前処理
void CombInit() {
    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 Comb(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(){
  CombInit();
  
  int N, K;
  cin >> N >> K;

  for (int i = 1; i <= K; ++i){
    if (2 * i > N) {
      cout << "0\";
      continue;
    }
    if (i == K) {
      cout << Comb(N, K) << endl;
      break;
    }
    
    int64_t mod1 = 0;
    for (int j = 0; j <= N - i; ++j){
      mod1 += Comb(i,j) % MOD;
    }
    int64_t mod2 = 0;
    for (int j = 0; j <= i+1; ++j){
      mod2 += Comb(i+1,j) % MOD;
    }
    
    cout << (mod1*mod2)%MOD << endl;
  }
  
  return 0;
}

Compiler output:
a.cc:38:15: warning: missing terminating " character
   38 |       cout << "0\";
      |               ^
a.cc:38:15: error: missing terminating " character
   38 |       cout << "0\";
      |               ^~~~~
a.cc: In function 'int main()':
a.cc:39:7: error: expected primary-expression before 'continue'
   39 |       continue;
      |       ^~~~~~~~
Language: C++

#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <queue>
#include <stack>
using namespace std;

const long long 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(){
    long long n, k;
    cin >> n >> k;
    COMinit()

//    long long ks[k];
//    for(long long i = 0; i < k; i++){
//        long long a = 1;
//        for(long long j = 0; j < i; j++){
//            a = (a*(k-i))%MOD;
//        }
//        ks[i] = a;
//    }
////    for(long long i = 0; i < k; i++){
////        cerr << ks[i] << endl;
////    }
    long long b = n-k;
//    long long ns[b];
//    for(long long i = 0; i < b; i++){
//        long long a = 1;
//        for(long long j = 0; j < i; j++){
//            a = (a*(b-i))%MOD;
//        }
//        ns[i] = a;
//    }
//    for(long long i = 0; i < b; i++){
//        cerr << ns[i] << endl;
//    }

    for(long long i = 0; i < k; i++){
        long long r = 0;
        if(i < b){
            r = (2*COM(k-1, i+1)*COM(b-1, i+1))%MOD;
        }
        if(i-1 >= 0){
            r = (r + COM(k-1, i+1)*COM(b-1, i))%MOD;
        }
        if(i+1 < b){
            r = (r + COM(k-1, i+1)*COM(b-1, i+1))%MOD;
        }
        cout << r << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:14: error: expected ';' before 'long'
   41 |     COMinit()
      |              ^
      |              ;
......
   54 |     long long b = n-k;
      |     ~~~~      
a.cc:69:16: error: 'b' was not declared in this scope
   69 |         if(i < b){
      |                ^
a.cc:73:40: error: 'b' was not declared in this scope
   73 |             r = (r + COM(k-1, i+1)*COM(b-1, i))%MOD;
      |                                        ^
a.cc:75:18: error: 'b' was not declared in this scope
   75 |         if(i+1 < b){
      |                  ^
Language: C++

#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<cassert>

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define endl "\n"

const long long INF = (long long)1e18;
const long long MOD = (long long)1e9 + 7; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}

#define MAX

#define MOD (long long)(1e9+7)
#define MAX_VAL (int)(1e5)

long long fac[MAX_VAL], mmi[MAX_VAL];

void factorial_mod(){
	 fac[0]=fac[1]=1;
	for(long long i = 2; i < MAX_VAL; fac[i]%=MOD,i++)
		fac[i] = fac[i-1]*(i%MOD);
}

long long power(long long x, long long n){
	long long ans = 1;
	for(;n;n>>=1,x*=x,ans%=MOD,x%=MOD)
		if(n&1)ans*=x;
	return ans%MOD;
}

void exgcd(int a, int b, int &x, int &y){
	if(b == 0){
		x = 1;
		y = 0;
		return ;
	}
	exgcd(b,a%b,y,x);
	y -= a/b * x;
}

void modular_multiplicatibe_inverse(){
	int x, y;  
	exgcd(fac[MAX_VAL-1],MOD,x,y);
	mmi[MAX_VAL-1] = x;
	for(long long i = MAX_VAL-2; i >= 0; mmi[i]%=MOD,i--)
		mmi[i] = mmi[i+1]*((i+1)%MOD);
}

long long combination(long long n, long long r){
	if(n < r) return 0;
	return fac[n]*(mmi[r]*mmi[n-r]%MOD)%MOD;
}

signed main(){
	// cin.tie(0);
	// ios::sync_with_stdio(false);
	// cout<<fixed<<setprecision(10);
	
	int N, K;
	
	factorial_mod();
	modular_multiplicatibe_inverse();
	
	
	cin>>N>>K;
	
	assert(1 <= K && K <= N && N <= 2000);
	
	for(int i = 1; i <= K; i++){
		int ans = 1;
		if(i > (N-K)+1){
			cout<<0<<endl;
			continue;
		}
		ans = combination((N-K) + 1, (N-K)-(i-1));
		ans = power(i+1,(N-K) - ());
		ans = ans*power(i,K - i);
		
		cout<<ans%MOD<<endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:86:42: error: expected primary-expression before ')' token
   86 |                 ans = power(i+1,(N-K) - ());
      |                                          ^
Language: C++

#include <bits/stdc++.h> 

using namespace std;

int main() {
  int N, K;

  cin>>N>>K;

  int ue = 1;

  for(int i=0; i<K; i++) {
    ue = ue * (K + i);
  }

  int sita1 = 1;

  for(int i=0; i<K; i++) {
    sita1 = sita1 *  (i + 1);
  }

  int sita2 = 1;

  for(int i=0; i<K; i++) {
    sita2 = sita2 * (N - K);
  }

  ans = ue / (sita1 * sita2); 

  for(int i=0; i<K; i++) {}
    cout<<ans<<endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |   ans = ue / (sita1 * sita2);
      |   ^~~
      |   abs
a.cc: At global scope:
a.cc:34:3: error: expected unqualified-id before 'return'
   34 |   return 0;
      |   ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = pow(10, 9) + 7;
//const int MOD = 998244353;
//const int MOD = ;
int mod(int A, int M) {return (A % M + M) % M;}
const int INF = 1LL << 60;
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const string abc = "abcdefghijklmnopqrstuvwxyz";
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
int myctoi(char C) {return C - 48;}
char myitoc(int N) {return '0' + N;}

class combination
{
public:
  vector<int> fac, finv, inv;

  combination(int M)
  {
    fac = vector<int>(M, 1);
    finv = vector<int>(M, 1);
    inv = vector<int>(M, 1);

    for (int i = 2; i < M; i++)
    {
      fac.at(i) = fac.at(i - 1) * i % MOD;
      inv.at(i) = MOD - inv.at(MOD % i) * (MOD / i) % MOD;
      finv.at(i) = finv.at(i - 1) * inv.at(i) % MOD;
    }
  }

  int COM(int N, int K)
  {
    if (N < K) return 0;
    if (N < 0 || K < 0) return 0;
    return fac.at(N) * (finv.at(K) * finv.at(N - K) % MOD) % MOD;
  }
};

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

  combination C(111111);

  for (int i = 0; i < K; i++)
  {
    int ans = C.COM(N - 1, i) * C.COM(N - K + 1, N - K - i) % MOD;
    ans *= finv.at(i + 1);
    ans %= MOD;
    cout << ans << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:12: error: 'finv' was not declared in this scope
   54 |     ans *= finv.at(i + 1);
      |            ^~~~
Language: C++

mod = 1000000007
nn,kk = map(int, raw_input().split())

factorial = [1]
for n in xrange(1, 2001):
    factorial.append(factorial[n-1]*n%mod)

def power(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y/2)**2 % mod
    else            : return power(x, y/2)**2 * x % mod

inverseFactorial = [0] * 2001
inverseFactorial[2001-1] = power(factorial[2001-1], mod-2)
for n in xrange(2001-2, -1, -1):
    inverseFactorial[n] = inverseFactorial[n+1] * (n+1) % mod

def combi(n, m):
    return factorial[n] * inverseFactorial[m] * inverseFactorial[n-m] % mod

for i in range(1,kk+1):
    print(combi(nn-kk+1,i)*combi(kk-1,i-1)%mod)

Compiler output:
a.cc:1:1: error: 'mod' does not name a type
    1 | mod = 1000000007
      | ^~~
Language: C++

/* D */

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

#define MOD 100000007

long long int (int k, int i){
	long long int p = 1;
	for (long long int j = 0; j < i; ++j)
	{
		p *= (k - j) % MOD;
	}
	return p;
}

int main(){
	long long int n, k;
	cin >> n >> k;

	std::vector<long long int> fact(n+1,0);
	fact[0] = 1;
	fact[1] = 1;

	for (long long int i = 2; i <= n; ++i)
	{
		fact[i] = fact[i-1] * i;
	}

	for (long long int i = 1; i <= k && i <= n-k+1; ++i)
	{	
		long long int a = pro(k, i);
		cout << a * (fact[k-1] / fact[i] * fact[k-i] * fact[i-1]) % MOD << endl;
	}
}

Compiler output:
a.cc:11:16: error: expected unqualified-id before 'int'
   11 | long long int (int k, int i){
      |                ^~~
a.cc:11:16: error: expected ')' before 'int'
   11 | long long int (int k, int i){
      |               ~^~~
      |                )
a.cc: In function 'int main()':
a.cc:35:35: error: 'pro' was not declared in this scope
   35 |                 long long int a = pro(k, i);
      |                                   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
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]+v[k-1][j]);
    }
  }
}

int main() {
    int n,k,i,ansi,v;
    cin >> n >> k;
    for(i=1;i<=k;i++){
        vector<vector<long long int> > v((n-k+1)+1,
        vector<long long int>((n-k+1)+1,0));
        comb(v);

        ansi = v[n-k+1][i]*(std::pow(2, k-1))%(1000000000+7);
        cout << ansi << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:46: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   23 |         ansi = v[n-k+1][i]*(std::pow(2, k-1))%(1000000000+7);
      |                                              ^~~~~~~~~~~~~~~
      |                                                          |
      |                                                          int
Language: C++

#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;

long combi(int,int);
int main(void){
    int N,K,p[2005];
    scanf("%d%d",&N,&K);
    for(int i=1;i<=K;i++){
        if(N+1>=2*K){
            printf("%ld\n",combi(K-1,i-1)*(N-K-i+1)%100000009)
        }else{
            printf("0\n");
        }
    }
}

long combi(int n,int r)
{
    long p=1;
    
    for(int i=1;i<=r;i++){
        p=p*(n-i+1)/i;
    }
    return p;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:63: error: expected ';' before '}' token
   12 |             printf("%ld\n",combi(K-1,i-1)*(N-K-i+1)%100000009)
      |                                                               ^
      |                                                               ;
   13 |         }else{
      |         ~
Language: C++

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

template <class T> using V = vector<T>;
template <class S, class T> using P = pair<S, T>;
template <class... T> using TP = tuple<T...>;

using ll = long long;
using db = double;
using ldb = long db;
using str = string;
using vll = V<ll>;
using vvll = V<V<ll>>;
using pll = P<ll,ll>;
using tpll = TP<ll,ll,ll>;
using vpll =V<pll>;
using vst = V<str>;
using vch = V<char>;

#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(b);i>(ll)(a);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(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 fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) __lcm(a,b)
#define co(a) cout<<a<<endl
#define ci(a) cin>>a
#define pb(a) push_back(a)
#define pob pop_back()
#define mp make_pair
#define mt make_tuple
#define pbmp(a,b) push_back(mp(a,b))
#define subs(a,b) substr(a,b)
#define cfs(a) cout<<fixed<<setprecision(a)
#define INF 1e16
#define mod 1e9+7


int main() {
  ldb n,k;
  cin>>n>>k;
  ldb bns=1,cns=1,ans=0;
  /*
  ans=(n+1)Ci*(k-1)Ci%mod
  */
  FOR(i,1,k+1){
    if(n-k+1<i&&k<i){
      FOR(j,1,i+1){
        bns*=(n-k+2-j)/j;
        cns*=(k-j)/j;
      }
    }
    if(n-k+1<i&&k<i){
      bns
      FOR(j,1,i+1){
     //   bns*=(n-k+2-j)/j;
        cns*=(k-j)/j;
      }
    }
  //  co(bns);
  //  co(cns);
    ans=bns*cns;
    co(ans);
    bns=1;
    cns=1;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:10: error: expected ';' before 'for'
   62 |       bns
      |          ^
      |          ;
a.cc:63:11: error: 'j' was not declared in this scope
   63 |       FOR(j,1,i+1){
      |           ^
a.cc:22:33: note: in definition of macro 'FOR'
   22 | #define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
      |                                 ^
Language: Java

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

public class Main {

  static final BigInteger BASE = BigInteger.valueOf(10).pow(9).add(BigInteger.valueOf(7));

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());
    int nBlue = k;
    int nRed = n - k;
    IntStream.rangeClosed(1, k).mapToObj(i -> solve(nBlue, nRed, i)).map(ABC132D::toAns)
      .map(String::valueOf).forEach(pw::println);
  }

  static BigInteger solve(int nBlue, int nRed, int i) {
    if (nRed < i - 1) {
      return BigInteger.ZERO;
    }
    BigInteger combinationBlue = combination(nBlue - 1, i - 1);
    int remainRed = nRed - (i - 1);
    int candidateRed = (i - 1) + 2;
    BigInteger combinationRed = combination(remainRed + candidateRed - 1, remainRed);
    return combinationBlue.multiply(combinationRed);
  }

  static BigInteger combination(long m, long n) {
    if (n == 0) {
      return BigInteger.ONE;
    }
    BigInteger ans = BigInteger.ONE;
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(new BigInteger(String.valueOf(m - i)));
      ans = ans.divide(new BigInteger(String.valueOf(i + 1)));
    }
    return ans;
  }

  static BigInteger toAns(BigInteger i) {
    return i.mod(BASE);
  }
}


Compiler output:
Main.java:21: error: cannot find symbol
    IntStream.rangeClosed(1, k).mapToObj(i -> solve(nBlue, nRed, i)).map(ABC132D::toAns)
                                                                         ^
  symbol:   variable ABC132D
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define INF 1000000007
//S.size()

using namespace std;


typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<bool> VB;
typedef unsigned long long ll;


/*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]+v[k-1][j]);
    }
  }
}*/


// テーブルを作る前処理
/*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;
}

//a,bの範囲的にこれだけ配列を用意していけば十分

ll mpow(ll x, ll n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % M;
        x = x*x % M;
        n = n >> 1;
    }
    return ans;
}

ll comb(ll a, ll b){ //aCbをmod計算
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = ifac[a-b]* ifac[b] % M;
    return tmp * fac[a] % M;
}*/
int calcNumOfCombination(int n, int r){
        int num = 1;
        for(int i = 1; i <= r; i++){
            num = num * (n - i + 1) / i;
        }
        return num;
    }
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]+v[k-1][j]);
        }
      }
}


int main(){
  int N,K;
  ll a,b;
  cin >> N >>K;
  int R = N - K;
  cout<<N - K + 1<<endl;
  /*for(int q = 2;q <= K;q++){
    vector<vector<long long int> > v(R+2,vector<long long int>(R+2,0));
    comb(v);
    vector<vector<long long int> > vv(N-1,vector<long long
    int>(N-1,0));
    comb(vv);
    cout << (v[R+1][q] * vv[N-1][q-1]) % INF<<endl;
  }*/
  /*for(int q = 2;q <= K;q++){
    COMinit();
    a = COM(R+1,q);
    COMinit();
    b = COM(K-1,q-1);
    cout<<a*b%INF<<endl;

  }*/

  for(int q = 2;q <=K;q++){
    vector<vector<long long int> > v(R+2,vector<long long int>(R+2,0));
    comb(v);
    a = v[R+1][i];
    vector<vector<long long int> > vv(K,vector<long long int>(K,0));
    comb(v);
    b = vv[K-1][i-1];
    cout << a*b%INF << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:113:16: error: 'i' was not declared in this scope
  113 |     a = v[R+1][i];
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int (i)=0;(i) < (N); (i)++)
#define all(V) V.begin(), V.end()
using i64 = long long;

int main(){
    i64 N,K;
    cin >> N >> K;
    i64 R = N-K;
    vector<vector<i64>> dp(K+1, vector<i64>(K+1,0));
    vector<vector<i64>> dpp(R+1, vector<i64>(R+1,0));
    const i64 MOD = 1e9+7;

    for(int i=0;i<=K;i++) dp[0][i] = 1;
    for(int i=0;i<=R;i++) dpp[0][i] = 1;

    for(int k=1;k<=K;k++){
        for(int i=1;i<=K;i++){
            dp[k][i] = (dp[k][i-1] + (k-i >= 0 ? dp[k-i][k] : 0)) % MOD;
        }
    }

    for(int r=1;r<=R;r++){
        for(int i=1;i<=r;i++){
            dpp[r][i] = (dpp[r][i-1] + (r-i >= 0 ? dpp[r-i][r] : 0)) % MOD;
        }
    }

    for(int i=1;i<=K;i++){
        i64 ans = (dp[K][i]*dpp[R][i-1] * (K-i+1)) % MOD;
        (ans += dp[K][i]*dpp[R][i] * (K-i+1) * 2) %= MOD;
        (ans += dp[K][i]*dpp[R][i+1] * (K-i+1))) %= MOD;
        cout << ans  << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:48: error: expected ';' before ')' token
   33 |         (ans += dp[K][i]*dpp[R][i+1] * (K-i+1))) %= MOD;
      |                                                ^
      |                                                ;
Language: Java

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

public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());
    int nBlue = k;
    int nRed = n - k;
    IntStream.rangeClosed(1, k).mapToObj(i -> solve(nBlue, nRed, i)).map(ABC132D::toAns)
      .map(String::valueOf).forEach(pw::println);
  }

  static BigInteger solve(int nBlue, int nRed, int i) {
    if (nRed < i - 1) {
      return BigInteger.ZERO;
    }
    BigInteger combinationBlue = combination(nBlue - 1, i - 1);
    int remainRed = nRed - (i - 1);
    int candidateRed = (i - 1) + 2;
    BigInteger combinationRed = combination(remainRed + candidateRed - 1, remainRed);
    return combinationBlue.multiply(combinationRed);
  }

  static BigInteger combination(long m, long n) {
    if (n == 0) {
      return BigInteger.ONE;
    }
    BigInteger ans = BigInteger.ONE;
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(new BigInteger(String.valueOf(m - i)));
      ans = ans.divide(new BigInteger(String.valueOf(i + 1)));
    }
    return ans;
  }

  static final BigInteger base = BigInteger.valueOf(10).pow(9).add(BigInteger.valueOf(7));

  static BigInteger toAns(BigInteger i) {
    return i.mod(base);
  }
}


Compiler output:
Main.java:19: error: cannot find symbol
    IntStream.rangeClosed(1, k).mapToObj(i -> solve(nBlue, nRed, i)).map(ABC132D::toAns)
                                                                         ^
  symbol:   variable ABC132D
  location: class Main
1 error
Language: C++

#define C (1000000000 + 7)

using namespace std;

int r(int n){
    if(n == 0) return 1;
    return n * r(n-1) % C;
}

int c(int a, int b){
    long x = 1;
    for(int i = a; i > a-b; i--){
        x *= i;
    }
    return x / r(b) % C;
}

int main(){
    int n, k;
    cin >> n >> k;
    int red = n - k;
    for(int i = 1; i <= k; i++){
        cout << c(k-1, i-1) * c(red+1, i) % C << endl; 
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'cin' was not declared in this scope
   20 |     cin >> n >> k;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define C (1000000000 + 7)
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout << c(k-1, i-1) * c(red+1, i) % C << endl;
      |         ^~~~
a.cc:23:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:50: error: 'endl' was not declared in this scope
   23 |         cout << c(k-1, i-1) * c(red+1, i) % C << endl;
      |                                                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define C (1000000000 + 7)
Language: C++

#pragma once
#include "stdafx.h"
#include<math.h>
#include<iostream>
#include <algorithm>
#include <string>
#include<vector>
#include <array>
#include<tuple>
#include<queue>
#include<stack>
#include<iomanip>
#include<bitset>
//AtCoderC++.cpp

using namespace std;

long long mod = pow(10, 9) + 7;

int N;
vector<long long> comb;

long long combination(long long n, long long r) {
	if (n == 1||n==0)return 1;
	if (n == r)	return 1;
	else if (r == 0)return 1;
	else if (r == 1)return n;
	else if (comb[N * n + r] != -1) return comb[N * n + r];
	else {
		auto res = (combination(n - 1, r - 1) + combination(n - 1, r)) % mod;
		comb[N * n + r] = res;
		return res;
	}
}

void solve() {
	int  K; cin >> N >> K;
	comb = vector<long long>(N * N, -1);
	for (size_t i = 1; i <= K; i++) {
		long long Blue = combination(K - i + 1, i - 1) % mod;
		long long place = combination(N - K + 1, i) % mod;
		cout << Blue * place%mod << endl;
	}
}

int main() {
	solve();
}

Compiler output:
a.cc:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
a.cc:2:10: fatal error: stdafx.h: No such file or directory
    2 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#define MOD 1000000007

long long int memo[2000]

unsigned long long int npr(unsigned int n, unsigned int r){
    unsigned long long int i;
    unsigned long long int result = n;
    for(i = n-1; i >= n-r+1; i--){
        result *= i;
        //result %= MOD;
    }
    return result;
}

unsigned long long int fn(unsigned int n){
    unsigned long long int i,result = n;
    for(i = n-1; i > 1; i--){
        result *= i;
    }
    return result;
}
/*
unsigned long long int calc(unsigned int n, unsigned int k, unsigned int i){
    unsigned long long int result = npr(n-k+1, i);
    result /= fn(i);
    result %= MOD;
    return result;
}
*/
unsigned long long int calc(unsigned int n, unsigned int k, unsigned int i){
    unsigned long long int result = n-k+1, j = n-k;
    
    for(; j >= i + 1; j--){
        result *= j;
        result %= MOD;
    }
    
    result /= fn(i-1);
    result %= MOD;
    return result;
}

int main(void){
    unsigned int n, k;
    int i;
    scanf("%u %u", &n, &k);
    
    printf("%u\n", n-k+1);
    printf("%llu\n", npr(n-k+1, 2));
    
    for(i = 3; i <= k; i++){
        //printf("%lld\n", npr(n-k+1, i)/fn(i));
        printf("%llu\n", calc(n, k, i));
    }
    
    return 0;
}

Compiler output:
main.c:4:25: error: expected ';' before 'unsigned'
    4 | long long int memo[2000]
      |                         ^
      |                         ;
    5 | 
    6 | unsigned long long int npr(unsigned int n, unsigned int r){
      | ~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#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 INF 999999999
#define P 1000000007
#define ll long long
using namespace std;

ll a[2001];
ll inv[2001];

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(){
  ll N,K,z1,z2,x = 1;
  cin >> N >> K;
  a[0] = 1;
  inv[0] = 1;
  FOR(i,1,N+1){
    x = (x*i)%P;
    a[i] = x;
    inv[i] = modinv(x,P);
  }
  FOR(i,1,K+1){
    if(N - K < i-1) cout << 0 << endl;
    else{
    z1 = ((a[N-K+1] * inv[i] % P) * inv[N-K-i+1] % P);
    z2 = ((a[K-1] * inv[i-1] % P) * inv[K-i] % P);
    cout << z1 * z2 % P << endl;
   }  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:27:11: note: to match this '{'
   27 | int main(){
      |           ^
Language: C

#include <stdio.h>
#define MOD 1000000007

long long int memo[2000]

unsigned long long int npr(unsigned int n, unsigned int r){
    unsigned long long int i;
    unsigned long long int result = n;
    for(i = n-1; i >= n-r+1; i--){
        result *= i;
        //result %= MOD;
    }
    return result;
}

unsigned long long int fn(unsigned int n){
    unsigned long long int i,result = n;
    for(i = n-1; i > 1; i--){
        result *= i;
    }
    return result;
}

unsigned long long int calc(unsigned int n, unsigned int k, unsigned int i){
    unsigned long long int result = npr(n-k+1, i);
    result /= fn(i);
    result %= MOD;
    return result;
}

unsigned long long int calc(unsigned int n, unsigned int k, unsigned int i){
    unsigned long long int result = n-k+1, j = n-k;
    
    for(; j >= i + 1; j--){
        result *= j;
        result %= MOD;
    }
    
    result /= fn(i-1);
    result %= MOD;
    return result;
}

int main(void){
    unsigned int n, k;
    int i;
    scanf("%u %u", &n, &k);
    
    printf("%u\n", n-k+1);
    printf("%llu\n", npr(n-k+1, 2));
    
    for(i = 3; i <= k; i++){
        //printf("%lld\n", npr(n-k+1, i)/fn(i));
        printf("%llu\n", calc(n, k, i));
    }
    
    return 0;
}

Compiler output:
main.c:4:25: error: expected ';' before 'unsigned'
    4 | long long int memo[2000]
      |                         ^
      |                         ;
    5 | 
    6 | unsigned long long int npr(unsigned int n, unsigned int r){
      | ~~~~~~~~                 
main.c:31:24: error: redefinition of 'calc'
   31 | unsigned long long int calc(unsigned int n, unsigned int k, unsigned int i){
      |                        ^~~~
main.c:24:24: note: previous definition of 'calc' with type 'long long unsigned int(unsigned int,  unsigned int,  unsigned int)'
   24 | unsigned long long int calc(unsigned int n, unsigned int k, unsigned int i){
      |                        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long n,k; cin>>n >>k;
  const long long mod 1e9+7;
  for(int i=1;i<=k;i++){
    long long ans=n-k+1;
    if(i>=2){
      for(int j=1;j<i;j++){
        ans*=(n-k)/i/i*k;
        ans%=mod;
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:23: error: expected initializer before numeric constant
    5 |   const long long mod 1e9+7;
      |                       ^~~
a.cc:11:14: error: 'mod' was not declared in this scope; did you mean 'modf'?
   11 |         ans%=mod;
      |              ^~~
      |              modf
Language: C++

import math

stri = input()
ary = stri.split()
n = int(ary[0])
k = int(ary[1])

ans1 = 1 * (n-k +1 )
ansi = ans1
print(ansi)

for i in range(2,k+1):
    ansi = ansi * (k- i + 1) / ( i - 1 ) *  (n-k - i + 2) / i 
    print(int(ansi % 1000000007))

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long n,k; cin>>n >>k;
  const int mod 1e9+7;
  for(int i=1;i<=k;i++){
    long long ans=n-k+1;
    if(i>=2){
      for(int j=1;j<i;j++){
        ans*=(n-k)/i/i*k;
        ans%=mod;
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: expected initializer before numeric constant
    5 |   const int mod 1e9+7;
      |                 ^~~
a.cc:11:14: error: 'mod' was not declared in this scope; did you mean 'modf'?
   11 |         ans%=mod;
      |              ^~~
      |              modf
Language: C++

#include<bits/stdc++.h>
using namespace std;
const long long mod 1e9+7;
int main(){
  long long n,k; cin>>n >>k;
  for(int i=1;i<=k;i++){
    long long ans=n-k+1;
    if(i>=2){
      for(int j=1;j<i;j++){
        ans*=(n-k)/i/i*k;
        ans%=mod;
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

Compiler output:
a.cc:3:21: error: expected initializer before numeric constant
    3 | const long long mod 1e9+7;
      |                     ^~~
a.cc: In function 'int main()':
a.cc:11:14: error: 'mod' was not declared in this scope; did you mean 'modf'?
   11 |         ans%=mod;
      |              ^~~
      |              modf
Language: Java

public class Main {
    public static void main(String... args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long[] a = new long[k + 1];

        for (int i = 1; i <= k; i++) {
            if (i == 1) {
                a[i] = nCr(n-k+1, i)%100000007;
            } else {
                a[i] = nCr(n-k+1, i)%100000007;
                a[i] *= nCr(k-1,i-1)%100000007;
            }
            System.out.println(a[i]);
        }

    }

    public static long nCr(int n, int r) {
        long num = 1;
        for (int i = 1; i <= r; i++) {
            num = num * (n - i + 1) / i;
        }
        return num;
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int fact(int n){
    sum = 1;
    for(int i=2;i<N+1;i++){
        sum *= i;
    }
    return sum;
}

int factstop(int n, int s){
    sum = 1;
    for (int i = n; i == 1; i--)
    {
       sum *= i;
    }
    return sum;
}

int main(void){
    int count = 0;
    int N, K;

    cin >> N >> K;
    int b = K;
    int r = N-K;

    for(int i=1;i<K+1;i++){
        int m = factstop(K, i-1)*factstop(N-K, i-1)/std::pow(fact(i-1), 2.0) % 1000000007;
        if(m!= 0){
            cout << m << endl;
        }
    }
}

Compiler output:
a.cc: In function 'int fact(int)':
a.cc:10:5: error: 'sum' was not declared in this scope
   10 |     sum = 1;
      |     ^~~
a.cc:11:19: error: 'N' was not declared in this scope
   11 |     for(int i=2;i<N+1;i++){
      |                   ^
a.cc: In function 'int factstop(int, int)':
a.cc:18:5: error: 'sum' was not declared in this scope
   18 |     sum = 1;
      |     ^~~
a.cc: In function 'int main()':
a.cc:35:78: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   35 |         int m = factstop(K, i-1)*factstop(N-K, i-1)/std::pow(fact(i-1), 2.0) % 1000000007;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
      |                                                    |                           |
      |                                                    |                           int
      |                                                    __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

def extended_gcd(a, b)
  last_remainder, remainder = a.abs, b.abs
  x, last_x, y, last_y = 0, 1, 1, 0
  while remainder != 0
    new_last_remainder = remainder
    quotient, remainder = last_remainder.divmod(remainder)
    last_remainder = new_last_remainder
    x, last_x = last_x - quotient*x, x
    y, last_y = last_y - quotient*y, y
  end

  return last_remainder, last_x * (a < 0 ? -1 : 1)
end

def invmod(e, et)
  g, x = extended_gcd(e, et)
  if g != 1
    raise "The maths are broken!"
  end
  x % et
end

n, k = read_line.split(" ").map(&.to_i)
b, r = k, n - k
k.times do |i|
  k = i + 2
  l = r - i
  if l == 0
    puts 1
    next
  end
  if l < 0
    puts 0
    next
  end
  left = k + l - 1
  right = [k - 1, l].min
  ret = 1_u64
  right.times do |i|
    ret = (ret * (left - i)) % 1000000007
    ret = (ret * invmod(i + 1, 1000000007)) % 1000000007
  end
  left = b - i - 1 + i
  right = [b - i - 1, i].min
  right.times do |i|
    ret = (ret * (left - i)) % 1000000007
    ret = (ret * invmod(i + 1, 1000000007)) % 1000000007
  end
  puts ret
end


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

#include <iostream>

using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 4e5 + 5;
const int MOD = 1e9 + 7;

int n, m, k;
int fact[N], invfact[N];

int pow(int a, int b, int m)
{
	int ans = 1;
	while (b)
	{
		if (b & 1)
			ans = (ans * a) % m;
		b /= 2;
		a = (a * a) % m;
	}
	return ans;
}

int modinv(int k)
{
	return pow(k, MOD - 2, MOD);
}

void precompute()
{
	fact[0] = fact[1] = 1;
	for (int i = 2; i < N; i++)
	{
		fact[i] = fact[i - 1] * i;
		fact[i] %= MOD;
	}
	invfact[N - 1] = modinv(fact[N - 1]);
	for (int i = N - 2; i >= 0; i--)
	{
		invfact[i] = invfact[i + 1] * (i + 1);
		invfact[i] %= MOD;
	}
}

int nCr(int x, int y)
{
	if (y > x)
		return 0;
	int num = fact[x];
	num *= invfact[y];
	num %= MOD;
	num *= invfact[x - y];
	num %= MOD;
	return num;
}

int d[int(1e5) + 10], C[2020][2020];
int bulec[2020], redc[2020];
int32_t main()
{
	IOS;
	cin >> n >> k;
	precompute();
	int ans = 0;
	for (int i = 0; i < k; i++) {//箱
		bulec[i] = nCr(k - 1, i);
		//cout << bulec[i] << "bule" << i << endl;
		redc[i] = 1;
	}
	int red = n - k;
	for (int i = 0; i < red; i++) {
		
		red = red - i;
		if (red < 0) {
			redc[i] = 0;
		}
		else if (red + i + 2 - 1 < red) {
			continue;
		}
		
		redc[i] = nCr(red+i+2-1, red);
		//cout << redc[i] << "red" << i << endl;
	}

	for (int i = 0; i < k; i++) {
		int ans = (bulec[i] * redc[i]) % MOD;
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc:7:13: error: expected primary-expression before 'long'
    7 | #define int long long
      |             ^~~~
a.cc:61:7: note: in expansion of macro 'int'
   61 | int d[int(1e5) + 10], C[2020][2020];
      |       ^~~
a.cc:61:7: error: expected ']' before 'long'
   61 | int d[int(1e5) + 10], C[2020][2020];
      |       ^
      |       ]
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
using namespace std;

unsigned long long int permutationMethod(unsigned long long int n, unsigned long long int r)
{
	r = n - r;
	unsigned long long int sum = 1;
	unsigned long long int i;
	for (i = n; i >= r + 1; i--)
		sum *= i;
	return sum;
}

unsigned long long int facctorialMethod(unsigned long long int k)
{
	unsigned long long int sum = 1;
	for (unsigned long long int i = 1; i <= k; ++i)
	{
		sum *= i;
	}
	return sum;
}

int main(void)
{
	int n,k;
	cin >> n >> k;
	
	for (int i = 0; i < k; i++)
	{
		unsigned long long int num = 0;
		if (i == 0)
		{
			num = facctorialMethod(n - k + 1) / facctorialMethod( n - k );
		}
		else
		{
			num = permutationMethod( n - k + 1 , i + 1);
			if (n - k + 1 == i + 1)
			{
				num /= facctorialMethod( i + 1 );
			}
		}
		if (num >= (int)pow(10.0, 9.0) + 7)
			num %= (int)pow(10.0, 9.0) + 7;
		cout << num << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:33: error: 'pow' was not declared in this scope
   47 |                 if (num >= (int)pow(10.0, 9.0) + 7)
      |                                 ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

const int mod = 1e9+7;

int g(int n, int r){
        int num = 1;
        for(int i = 1; i <= r; i++){
            num = (num * (n - i + 1) / i) % mod;
        }

        return num;
    }

int main() {
    int n, k;
    cin >> n >> k;
    int f[k+1];
    rep(i, k+1) {
        f[i] = 0;
    }

    for(int i = 1; i <= n-k+1; i++) {
        f[i] = g(n-k+1, i)*(g(k-1, i-1) % mod;
    }

    for(int i = 1; i <= k; i++) {
        cout << f[i] << "\n";
    }
    
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:46: error: expected ')' before ';' token
   31 |         f[i] = g(n-k+1, i)*(g(k-1, i-1) % mod;
      |                            ~                 ^
      |                                              )
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
using namespace std;

unsigned long long int permutationMethod(unsigned long long int n, unsigned long long int r)
{
	r = n - r;
	unsigned long long int sum = 1;
	unsigned long long int i;
	for (i = n; i >= r + 1; i--)
		sum *= i;
	return sum;
}

unsigned long long int facctorialMethod(unsigned long long int k)
{
	unsigned long long int sum = 1;
	for (unsigned long long int i = 1; i <= k; ++i)
	{
		sum *= i;
	}
	return sum;
}

int main(void)
{
	int n,k;
	cin >> n >> k;
	
	for (int i = 0; i < k; i++)
	{
		unsigned long long int num = 0;
		if (i == 0)
		{
			num = facctorialMethod(n - k + 1) / facctorialMethod( n - k );
		}
		else
		{
			num = permutationMethod( n - k + 1 , i + 1);
			if (n - k + 1 == i + 1)
			{
				num /= facctorialMethod( i + 1 );
			}
		}
		if (num >= (int)pow(10, 9) + 7)
			num %= (int)pow(10, 9) + 7;
		cout << num << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:33: error: 'pow' was not declared in this scope
   47 |                 if (num >= (int)pow(10, 9) + 7)
      |                                 ^~~
Language: C++

#include <iostream>
#include <vector>
#include <list>
#include <math.h>
#include <algorithm>
#include <functional>
#include <string>
#include <iomanip>
#include <queue>
#include <map>

long long pMethod(long long n, long long r) {
	r = n - r;
	if (r == 0) return 1;
	long long sum = 1;
	long long i;
	for (i = n; i >= r + 1; i--)sum *= i;
	return sum;
}

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



	for (int i = 1; i < K+1; i++) {
		long long ans = pMethod(N - K + 1, i);
//		std::cout << long long(pow(10, 9) + 7) << std::endl;
		std::cout << ans << std::endl;

		ans = ans % long long(pow(10, 9) + 7);
//		std::cout << ans << std::endl;
	}



}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:29: error: expected primary-expression before 'long'
   35 |                 ans = ans % long long(pow(10, 9) + 7);
      |                             ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int comb(int x, int y) {
  int a = 1;
  for(int i = 0; i < y; i++){
    a *= (x-i);
    a /= (i+1);
    a %= 1000000007
  }
  return a;
}
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= k; i++)
    cout << comb(k-1,i-1)*comb(n-k+1,i) << endl;  
  //for(int i = 0; i < 5; i++)
    //cout << comb(5,i) << endl;
}


Compiler output:
a.cc: In function 'int comb(int, int)':
a.cc:8:20: error: expected ';' before '}' token
    8 |     a %= 1000000007
      |                    ^
      |                    ;
    9 |   }
      |   ~