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

#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const ll M = 1e9+7;

/*
ll fact(int n)
{
	if (n == 0)
	{
		return 1;
	}
	else
	{
		ll ans = 1;
		for (int i = 1; i <= n; ++i)
		{
			ans *= i;
		}
		return ans;
	}
}

ll comb(int n, int k) //nCk
{
	if (k == 0)
	{
		return 1;
	}
	else
	{
		ll ans;
		ans = ((fact(n) / fact(n-k)) / fact(k)) % M;
		return ans;
	}
}
*/

ll P[2005][2005];

void init()
{
	for (int i = 0; i < 2005; ++i)
	{
		for (int j = 0; j < 2005; ++j)
		{
			P[i][j] = 0;
		}
	}
	P[0][0] = 1;
	for (int i = 0; i < 2004; ++i)
	{
		for (int j = 0; j <= i; ++j)
		{
			P[i+1][j] += P[i][j];
			P[i+1][j+1] += P[i][j];
		}
	}
}

ll pascal(int n,int k)
{	
	if (n < k)
	{
		return 0;
	}
	else if ((n < 1)||(k < 1))
	{
		return 1;
	}

	return P[n][k];
}

ll comb2(int n, int k)
{
  long long c = 1;
  for (int i = 0; i < k; i++) 
  {
    c = (c * (n-i)/(k-i)) % MOD;
  }
  return c;
}

int main()
{
	init();
	int N,K;
	cin >> N >> K;
	int ans;
	for (int i = 1; i <= K; ++i)
	{
		if (i > N-K+1)
		{
			cout << 0 << endl;
		}
		else
		{
			//cout << pascal(N-K+1,i) << " " << pascal(K-1,i-1)<< " ";
			ans = (comb2(N-K+1,i) % M) * (comb2(K-1,i-1) % M) % M;
			cout << ans << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'll comb2(int, int)':
a.cc:81:29: error: 'MOD' was not declared in this scope
   81 |     c = (c * (n-i)/(k-i)) % MOD;
      |                             ^~~
Language: C++

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

const long long D = (long long)(1e9) + 7;

long long ext_gcd(long long a, long long b, long long &x, long long &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    long long d = ext_gcd(b, a % b, y, x);
    y -= a/b * x;
    return d;
}

long long inv_mod(long long a, long long mod) {
    long long x, y;
    ext_gcd(a, mod, x, y);
    x %= mod;
    if (x < 0) { x += mod; }
    return x;
}

long long calc_combi(long long n, long long r) {
    if (r == 0) { return 1; }
        long long a = 1, b = 1;
        for (int i = 1; i <= r; i++) {
            a = (a * (n - i + 1)) % D;
            b = (b * i) % D;
        }
        long long result = a * inv_mod(b, D) % D;
        if (result < 0) { result += D }
        return result;
}

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

    for (int i = 1; i <= k; i++) {
        int sep = n - k + 1;
        if (i > sep) {
            cout << 0 << endl;
            break;
        }
        
        long long red_combi = calc_combi(sep, i);
        long long blue_combi = calc_combi(k-1, i-1);
        long long result = (red_combi * blue_combi) % D;
        cout << result << endl;
    }
  return 0;
}



Compiler output:
a.cc: In function 'long long int calc_combi(long long int, long long int)':
a.cc:33:38: error: expected ';' before '}' token
   33 |         if (result < 0) { result += D }
      |                                      ^~
      |                                      ;
Language: C++

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

const long long D = (long long)(1e9) + 7;

long long ext_gcd(long long a, long long b, long long &x, long long &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    long long d = ext_gcd(b, a % b, y, x);
    y -= a/b * x;
    return d;
}

long long inv_mod(long long a, long long mod) {
    long long x, y;
    ext_gcd(a, mod, x, y);
    x %= mod;
    if (x < 0) { x += mod; };
    return x;
}

long long calc_combi(long long n, long long r) {
    if (r == 0) { return 1; }
        long long a = 1, b = 1;
        for (int i = 1; i <= r; i++) {
            a = (a * (n - i + 1)) % D;
            b = (b * i) % D;
        }
        long long result = a * inv_mod(b, D) % D;
        if (result < 0) { result += D }
        return result;
}

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

    for (int i = 1; i <= k; i++) {
        int sep = n - k + 1;
        if (i > sep) {
            cout << 0 << endl;
            break;
        }
        
        long long red_combi = calc_combi(sep, i);
        long long blue_combi = calc_combi(k-1, i-1);
        long long result = (red_combi * blue_combi) % D;
        cout << result << endl;
    }
  return 0;
}



Compiler output:
a.cc: In function 'long long int calc_combi(long long int, long long int)':
a.cc:33:38: error: expected ';' before '}' token
   33 |         if (result < 0) { result += D }
      |                                      ^~
      |                                      ;
Language: C++

import java.util.*;
import static java.lang.Integer.*;
//import static java.lang.Long.*;
//import static java.lang.Math.*;

public class Main {
	public static void main(String[] args) {
		long i,j;
		Scanner sc = new Scanner(System.in);
		int n = parseInt(sc.next());
		int k = parseInt(sc.next());
		sc.close();
		long ans = n-k+1;
		System.out.println(ans);
		long kake = ans;
		long kake2 = 1;
		for(i=2;i<=k;i++) {
			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;
			ans = kake  * kake2;
			if(ans > 1000000007) ans %= 1000000007;
			System.out.println(ans);
		}
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import static java.lang.Integer.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class Main {
      | ^~~~~~
Language: C++

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

#define int long long 
#define pii pair<int,int>
#define vi vector<int>
#define vvi vector<vi>
#define vpii vector<pi> 
#define vvpii vector<vpii>
#define all(V) V.begin(),V.end()
#define mpii map<int,int> 
#define mpci map<char,int> 
#define fi first
#define si second
#define pb(V) push_back(V)
#define mp(a,b) make_pair(a,b)
#define mt(a,b,c) make_tuple(a,b,c)
#define forn(i,n) for (int i = 0; i < int(n); ++i)


const int N = 3000;
const int mod = 1e9 + 7;
vi fact(N,0);

int binpow(int a,int b)
{
	int res = 1;
	while(b)
	{
		if(b & 1)
		{
			res = (res*a)%mod;
		}
		b >>= 1;
		a = (a*a)%mod;
	}
	return res%mod;
}
void precompute()
{
	fact[0] = 1;
	for(int i = 1; i < N; ++i)
	{
		fact[i] = (fact[i-1]*i)%mod;
	}
}

int nCr(int n, int r)
{
	int num = fact[n]%mod;
	int div = (fact[r]*fact[n-r])%mod;
	int inv = binpow(div,mod-2);
	inv %= mod;
	return (num*inv)%mod;
}
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n,k;
	cin >> n >> k;
	precompute();
	//~ cout << fact[6] << " ";
	//~ cout << nCr(5,2);
	for(int i = 1; i <= k; ++i)
	{
		else
		{
			int x = nCr(k-1,i-1);
			int y = nCr(n-k+1,i);
			if((x*y)%mod < 0)
			{
				cout << 0 << '\n';
			}
			else
			cout << (x*y)%mod << '\n';
		}
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:67:17: error: 'else' without a previous 'if'
   67 |                 else
      |                 ^~~~
Language: C++

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


long long fact[10005];
long long inv[10005];
long long finv[10005];
long long init(int n){
	fact[0]=finv[0]=1;
	inv[1]=1;
	for(int i=2;i<n;i++){
		inv[i]=(MOD-(MOD/i)*inv[MOD%i]%MOD)%MOD;
	}
	for(int i=1;i<n;i++){
		fact[i]=fact[i-1]*i%MOD;
		finv[i]=finv[i-1]*inv[i]%MOD;
	}
}
long long comb(long long n, long long k){
    if( a < b || b < 0 )return 0;
    return fact[n]*finv[n-k]%MOD*finv[k]%MOD;
}

int main(){
    init(6000);
    int N, K; cin >> N >> K;
    int red = N-K, blue = K;


    long long ans = 1;
    for( int i = 1; i <= K; i++ ){
        ans *= comb( red + 1 , i );
        ans *= comb( blue - 1 , i - 1 );
        ans %= MOD;

        cout << ans << endl;
        ans = 1;
    }
}

Compiler output:
a.cc: In function 'long long int init(int)':
a.cc:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | }
      | ^
a.cc: In function 'long long int comb(long long int, long long int)':
a.cc:21:9: error: 'a' was not declared in this scope
   21 |     if( a < b || b < 0 )return 0;
      |         ^
a.cc:21:13: error: 'b' was not declared in this scope
   21 |     if( a < b || b < 0 )return 0;
      |             ^
Language: C++

#include<bits/stdc++.h>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
#define MOD ((ll)1e9+7)
ll N,K;
ll C[4040][4040];
ll i,j,ans;
int main(){
    scanf("%lld%lld", &N,&K);

    C[0][0]=1;
    fornum(i,0,N){
        C[i + 1][0] = 1;
        fornum(j,0,N){
            C[i + 1][j + 1] = (C[i][j] + C[i][j + 1]) % MOD;
        }
    }
    ll R = N - K;
    ll B = K;
    j = 0;
    if(R>0){
        j += C[R-1][1];
        j += C[R-1][0] * 2;
        printf("%lld\n", j%MOD);
    }else{
        printf("1\n", j%MOD);
    }
    
    fornum(i,2,B+1){
        j = 0;
        if(R>0){
            j = C[R-1][i] % MOD;
            j = (j + C[R-1][i - 1]*2) % MOD;
            j = (j + C[R-1][i - 2]) % MOD;
            printf("%lld\n", j * C[B-1][i - 1] % MOD);
        }else{
            printf("0\n")
        }
        //printf("%lld %lld\n", j, C[B - 1][i - 1]);
        
        
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:26: error: expected ';' before '}' token
   45 |             printf("0\n")
      |                          ^
      |                          ;
   46 |         }
      |         ~
Language: C++

//#include<bits/stdc++.h>	// 全てのヘッダーファイルをinclude
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<set>
#include<map>
#include<utility>	// 値入れ替えの関数 wrap
#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++)
const int MOD{ int(1e9 + 7) };	// int 1000000007
const int inf{ int(1e9) };	// inf = 1000000000 // 1e9 はdouble型
using namespace std;
typedef long long ll;

// 最大公約数（ユークリッドの互除法）
int GCD(int x, int y) {
	if (x > y) {
		swap(x, y);
	}
	int r = y % x;
	while (r != 0) {
		y = x;
		x = r;
		r = y % x;
	}
	return x;
}

// 最小公倍数
int LCM(int x, int y) {
	ll gcd = GCD(x, y);
	return x * y / gcd;
}

// 素数判定(素数ならtrue,合成数ならfalse)
bool IsPrime(int num) {
	if (num < 2) return false; // 0,1
	else if (num == 2) return true;	// 2
	else if (num % 2 == 0) return false; // 偶数

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2) {
		if (num % i == 0) return false; // 割り切れたら素数ではない
	}
	return true; // 全部通ったら素数
}

ll nCr(ll n, ll r) {
	vector<vector<ll> > dp(n + 1, vector<ll>(n + 1, 0));
	REP(i,n+1) dp[i][0] = 1;
	dp[1][1] = 1;

	for (int i = 2; i <=n ; i++) {
		for (int j = 1; j <= i; j++) {
			dp[i][j] = (dp[i - 1][j] + dp[i - 1][j - 1]) % MOD;
		}
	}

	REP(i, 1, n + 1) dp[i][0] = 1;

	return (dp[n][r] % MOD);
}

// ----------------------------------------------------------------

int main(void) {

	ll n, k;
	cin >> n >> k;
	ll l = n - k;

	for (int i = 1; i <= k; i++) {
		ll red = nCr(l + 1, i);
		ll blue = nCr(k - 1, i - 1);
		cout << (red * blue) % MOD << endl;
	}

	return 0;
}

Compiler output:
a.cc:62:24: error: macro "REP" passed 3 arguments, but takes just 2
   62 |         REP(i, 1, n + 1) dp[i][0] = 1;
      |                        ^
a.cc:10:9: note: macro "REP" defined here
   10 | #define REP(i,n) for(int i=0;i<n;i++)
      |         ^~~
a.cc: In function 'll nCr(ll, ll)':
a.cc:62:9: error: 'REP' was not declared in this scope
   62 |         REP(i, 1, n + 1) dp[i][0] = 1;
      |         ^~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll mod=1e9+7;

const int N=6666;

ll n,k;

ll c[N][N];

ll dp[N];

ll C(ll n,ll m)

{

    if(c[n][m]) return c[n][m];

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

    if(m==1) return n;

    return c[n][m]=(C(n-1,m-1)+C(n-1,m))%mod;

}

int main()

{

    scanf("%lld%lld",&n,&k);

    int s=n-k;

dp[0]=1;
    for(int i=1;i<=s;i++)

        dp[i]=C(s-1,i-1);

    for(int i=1;i<=k;i++)

    {

        if(i>n-k+1)

        {

            printf("0\n");

            continue;

        }
        ans=(ans+C(k-1,i-1)*dp[i-1])%mod;

        ans=(ans+C(k-1,i-1)*dp[i]%mod*2%mod)%mod;

        ans=(ans+C(k-1,i-1)*dp[i+1]%mod)%mod;

        printf("%lld\n",(ans%mod+mod)%mod);

    }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   57 |         ans=(ans+C(k-1,i-1)*dp[i-1])%mod;
      |         ^~~
      |         abs
Language: Java

import java.util.*;
public class Main {
  	static int mod = 1000000007;
  static int size = 200001;
	static long[] fac = new long[size];
	static long[] finv = new long[size];
	static long[] inv = new long[size];
	static int INF = Integer.MAX_VALUE;
public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	// 整数の入力
	int N = sc.nextInt();
    int K = sc.nextInt();
  int red =N-K;
  long kazu = 0;
  initComb();
System.out.println(N-K+1);
  int a =0;
  int b =1;
  for(int i=1;i<K;i++){
    kazu=0;
    for(a=0;a<red-i+1;a++){
      b=red-a;
      if(i!=1){
      kazu= (kazu + comb(K-1,i)*(a+1)*comb(b-1,i-1)) % mod;
      }
    }


} 

 //fac, inv, finvテーブルの初期化、これ使う場合はinitComb()で初期化必要
	public static  void initComb(){
		fac[0] = finv[0] = inv[0] = fac[1] = finv[1] = inv[1] = 1;
		for (int i = 2; i < size; ++i) {
			fac[i] = fac[i - 1] * i % mod;
			inv[i] = mod - (mod / i) * inv[(int) (mod % i)] % mod;
			finv[i] = finv[i - 1] * inv[i] % mod;
		}
	}
 
	//nCk % mod
	public static long comb(int n, int k){
        if (n < k) return 0;
        if (n < 0 || k < 0) return 0;
		return fac[n] * finv[k] % mod * finv[n - k] % mod;
	}
 
	//n! % mod
	public static long fact(int n){
		return fac[n];
	}
 
	//(n!)^-1 with % mod
	public static long finv(int n){
		return finv[n];
	}
  
}



Compiler output:
Main.java:33: error: illegal start of expression
	public static  void initComb(){
	^
1 error
Language: C++

#include <iostream>
#include <vector>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
using namespace std;

#ifdef DEBUG
    #define IFD if(true)
#else
    #define IFD if(false)
#endif

//////////////////////////////////////////////////
//
// フェルマーの小定理による実装
// （mod の値は素数である必要があるが、大きい n に対応可能）
//

// 参考 : https://qiita.com/ofutonfuton/items/92b1a6f4a7775f00b6ae

#include <vector>
template<typename T_mcf_data>

class ModCombF
{
private:
    int max_n;
    T_mcf_data mod; // M
    std::vector<T_mcf_data> fac; // n! (mod M)
    std::vector<T_mcf_data> ifac; // k!^{M - 2} (mod M)

    T_mcf_data mpow(T_mcf_data x, T_mcf_data n)
    {
        T_mcf_data ans = 1;
        while(n != 0) {
            if(n & 1) {
                ans = ans * x % mod;
            }
            x = x * x % mod;
            n = n >> 1;
        }
        return ans;
    }

public:

    // 引数: n の最大値、M は mod の値
    ModCombF(int n, T_mcf_data M) : fac(n + 1), ifac(n + 1)
    {
        max_n = n;
        mod = M;
        fac[0] = 1;
        ifac[0] = 1;
        for(int i = 0; i < n; i++) {
            fac[i + 1] = fac[i] * (i + 1) % mod;
            ifac[i + 1] = ifac[i] * mpow(i + 1, mod - 2) % mod;
        }
    }

    // aCb を求める
    T_mcf_data calc(T_mcf_data a, T_mcf_data b)
    {
        if(a > max_n || a < b || a < 0) return 0; // error
        if(a == 0 && b == 0) return 1;
        T_mcf_data tmp = ifac[a - b] * ifac[b] % mod;
        return tmp * fac[a] % mod;
    }
};
//////////////////////////////////////////////////



int main()
{
    int N, K;
    cin >> N >> K;
    ll mod = 1000000007;
    ModComb<ll> mc(N, mod);

    rep(i, K) {
        ll ans = 0;
        // (N-K+1)C(i+1) 赤い石の間に青い石を入れる総数
        IFD cout << "i: " << i << endl << N - K + 1 << " " << i + 1 << " " << K - 1 << endl;
        ans = mc.calc(N - K + 1, i + 1);
        if(i != 0) {
            // (K-1)C(i) 青い石の塊ごとに何個ずつにするかの総数
            ans = ans * mc.calc(K - 1, i) % mod;
        }
        cout << ans << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:79:5: error: 'ModComb' was not declared in this scope; did you mean 'ModCombF'?
   79 |     ModComb<ll> mc(N, mod);
      |     ^~~~~~~
      |     ModCombF
a.cc:79:15: error: expected primary-expression before '>' token
   79 |     ModComb<ll> mc(N, mod);
      |               ^
a.cc:79:17: error: 'mc' was not declared in this scope
   79 |     ModComb<ll> mc(N, mod);
      |                 ^~
Language: C++

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

using namespace std;

const int mod=1e9+7;

unsigned long long combi(int m, int k){
	unsigned long long a = 1;
	
	if(k == 0)return 1;
	if(m < k )return 0;
	
	if(k > m-k) k = m-k;
	for(int i = 0; i < k ; i++) {
		a *= (m-i);
		a /= (i+1);
		a = a % mod;
		}
	return a;
}
int main() {
	int N,int b;
	int r = N-b;
	unsigned long long count;
	for(int i = 1;i <= b;i++){
		count = combi(r+1,i) * combi(b-1,i-1);
		cout << combi(r+1,i) <<", "<<combi(b-1,i-1)<<", ";
		cout << count % 1000000007 << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: expected unqualified-id before 'int'
   24 |         int N,int b;
      |               ^~~
a.cc:25:19: error: 'b' was not declared in this scope
   25 |         int r = N-b;
      |                   ^
Language: C++

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

using namespace std;

const int mod=1e9+7;

unsigned long long combi(int m, int k){
	unsigned long long a = 1;
	
	if(k == 0)return 1;
	if(m < k )return 0;
	
	if(k > m-k) k = m-k;
	for(int i = 0; i < k ; i++) {
		a *= (m-i);
		a /= (i+1);
		a = a % mod;
		}
	return a;
}
int main() {
	int N,int b
	int r = N-b;
	unsigned long long count;
	for(int i = 1;i <= b;i++){
		count = combi(r+1,i) * combi(b-1,i-1);
		cout << combi(r+1,i) <<", "<<combi(b-1,i-1)<<", ";
		cout << count % 1000000007 << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: expected unqualified-id before 'int'
   24 |         int N,int b
      |               ^~~
a.cc:27:28: error: 'b' was not declared in this scope
   27 |         for(int i = 1;i <= b;i++){
      |                            ^
a.cc:28:31: error: 'r' was not declared in this scope
   28 |                 count = combi(r+1,i) * combi(b-1,i-1);
      |                               ^
Language: C++

int main(){
    int N, K ;
    cin >> N >> K;
    int lim = min(N-K+1, K);
    long comb = N - K + 1;
    cout << comb << endl;
    int low = pow(10, 9) + 7;
    for(int i=2; i < lim + 1; i++){
        comb = comb*(N-K+2-i)*(K+1-i);
        comb /= i*(i-1);
        comb %= low;
        cout << comb << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N >> K;
      |     ^~~
a.cc:4:15: error: 'min' was not declared in this scope; did you mean 'main'?
    4 |     int lim = min(N-K+1, K);
      |               ^~~
      |               main
a.cc:6:5: error: 'cout' was not declared in this scope
    6 |     cout << comb << endl;
      |     ^~~~
a.cc:6:21: error: 'endl' was not declared in this scope
    6 |     cout << comb << endl;
      |                     ^~~~
a.cc:7:15: error: 'pow' was not declared in this scope; did you mean 'low'?
    7 |     int low = pow(10, 9) + 7;
      |               ^~~
      |               low
Language: C++

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

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
using ll = long long;
using ull = unsigned long long;
constexpr int MOD = 1000000007;

vector<int> v;

int mod(ll x){
    return x % MOD;
}
int modm(ll x,ll m){
    return x * m % MOD;
}

int modpow(ll x, ll p) {
    int ret = 1;
    while(p > 0) {
        if (p & 1) ret = modm(ret,x);
        x = modm(x,x);
        p >>= 1;
    }
    return ret;
}

// x * modinv(d)
int modd(ll x,ll d) {
    return modm(x,modpow(d,MOD-2));
}

ll conv(int n,int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return modd(v[n],modm(v[k],v[n-k]);
}

int main(void)
{
    IOS
    int n,k; cin >> n >> k;

    v.resize(n+1);
    v[0] = 1;
    v[1] = 1;
    FOR(i,2,n+1) {
        v[i] = modm(v[i-1],i);
    }

    FOR(i,1,k+1) {
        ll x = modm(conv(n-k+1,i) ,conv(k-1,i-1));
        cout << x << endl;
    }


    return 0;
}


Compiler output:
a.cc: In function 'll conv(int, int)':
a.cc:40:39: error: expected ')' before ';' token
   40 |     return modd(v[n],modm(v[k],v[n-k]);
      |                ~                      ^
      |                                       )
Language: Java

import java.util.*;
public class Main {
  	static int mod = 1000000007;
  static int size = 200000;
	static long[] fac = new long[size];
	static long[] finv = new long[size];
	static long[] inv = new long[size];
	static int INF = Integer.MAX_VALUE;
public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	// 整数の入力
	int N = sc.nextInt();
    int K = sc.nextInt();
  int red =N-K;
  int kazu = 0;
  initComb();
 System.out.println(N-K+1);
  int a =0;
  int b =1;
  for(int i=1;i<K;i++){
    kazu=0;
    for(a=0;a<red-i;a++){
      b=red-a;
      kazu= (kazu + comb(K-1,i)*(a+1)*comb(b,i-1))%MOD;
    }
    System.out.println(kazu);
  }


} 

 //fac, inv, finvテーブルの初期化、これ使う場合はinitComb()で初期化必要
	public static  void initComb(){
		fac[0] = finv[0] = inv[0] = fac[1] = finv[1] = inv[1] = 1;
		for (int i = 2; i < size; ++i) {
			fac[i] = fac[i - 1] * i % mod;
			inv[i] = mod - (mod / i) * inv[(int) (mod % i)] % mod;
			finv[i] = finv[i - 1] * inv[i] % mod;
		}
	}
 
	//nCk % mod
	public static long comb(int n, int k){
		return fac[n] * finv[k] % mod * finv[n - k] % mod;
	}
 
	//n! % mod
	public static long fact(int n){
		return fac[n];
	}
 
	//(n!)^-1 with % mod
	public static long finv(int n){
		return finv[n];
	}
  
}

Compiler output:
Main.java:24: error: cannot find symbol
      kazu= (kazu + comb(K-1,i)*(a+1)*comb(b,i-1))%MOD;
                                                   ^
  symbol:   variable MOD
  location: class Main
1 error
Language: C

using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++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 all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
bool f(string s){
  bool ans=true;
  rep(i,s.size()/2){
    if(s[i]!=s[s.size()/2+i]){
      ans=false;
      break;
    }
  }
  return ans;
}



int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N,K;
  cin>>N>>K;
  ll C[N][N];
  C[1][1]=1;
  C[1][0]=1;
  FOR(i,2,N){
    FOR(j,1,i){
      C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
    }
    C[i][i]=1;
  }
  FOR(i,1,K+1){
  cout<<C[N-K+1][i]*C[K-1][i-1];
  }
  
  
  
}
    
  
  


Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using namespace std;
      | ^~~~~
main.c:1:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    1 | using namespace std;
      |                 ^~~
main.c:2:10: fatal error: bits/stdc++.h: No such file or directory
    2 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main()
{
  long double num = 1000000007;
  int n, k;
  cin >> n >> k;
  int k_1 = k - 1;
  int n_k_1 = n - k + 1;

  long double answer = n - k + 1;
  cout << answer << endl;
  for (int i = 2; i <= k; i++)
  {
    if (n_k_1 < i)
    {
      cout << 0 << endl;
    }
    else
    {
      answer = (answer * (k_1 - (i - 2)) * (n_k_1 - (i - 1)) / i / (i - 1));
      cout << answer % num << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: invalid operands of types 'long double' and 'long double' to binary 'operator%'
   23 |       cout << answer % num << endl;
      |               ~~~~~~ ^ ~~~
      |               |        |
      |               |        long double
      |               long double
Language: C++

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

int main()
{
  long num = 1000000007;
  int n, k;
  cin >> n >> k;
  int k_1 = k - 1;
  int n_k_1 = n - k + 1;

  long double answer = n - k + 1;
  cout << answer << endl;
  for (int i = 2; i <= k; i++)
  {
    if (n_k_1 < i)
    {
      cout << 0 << endl;
    }
    else
    {
      answer = (answer * (k_1 - (i - 2)) * (n_k_1 - (i - 1)) / i / (i - 1));
      cout << answer % num << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: invalid operands of types 'long double' and 'long int' to binary 'operator%'
   23 |       cout << answer % num << endl;
      |               ~~~~~~ ^ ~~~
      |               |        |
      |               |        long int
      |               long double
Language: C++

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

int main()
{
  long num = 1000000007;
  int n, k;
  cin >> n >> k;
  int k_1 = k - 1;
  int n_k_1 = n - k + 1;

  int64 answer = n - k + 1;
  cout << answer << endl;
  for (int i = 2; i <= k; i++)
  {
    if (n_k_1 < i)
    {
      cout << 0 << endl;
    }
    else
    {
      answer = (answer * (k_1 - (i - 2)) * (n_k_1 - (i - 1)) / i / (i - 1));
      cout << answer % num << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'int64' was not declared in this scope
   12 |   int64 answer = n - k + 1;
      |   ^~~~~
a.cc:13:11: error: 'answer' was not declared in this scope
   13 |   cout << answer << endl;
      |           ^~~~~~
Language: C++

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

int main()
{
  long num = 1000000007;
  int n, k;
  cin >> n >> k;
  int k_1 = k - 1;
  int n_k_1 = n - k + 1;

  int64 answer = n - k + 1;
  cout << answer << endl;
  for (int i = 2; i <= k; i++)
  {
    if (n_k_1 < i)
    {
      cout << 0 << endl;
    }
    else
    {
      answer = (answer * (k_1 - (i - 2)) / (i - 1) * (n_k_1 - (i - 1)) / i);
      cout << answer % num << endl;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'int64' was not declared in this scope
   12 |   int64 answer = n - k + 1;
      |   ^~~~~
a.cc:13:11: error: 'answer' was not declared in this scope
   13 |   cout << answer << endl;
      |           ^~~~~~
Language: C++


#include <iostream>
#include <algorithm>
#include <functional>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;

long long int nCk(long long int n, long long int k) {
	long long int r = 1;
	for (long long int d = 1; d <= k; ++d) {
		r *= n--;
		r /= d;
	}
	return r;
}

int main()
{
	long long int n, k;
	cin >> n >> k;
	long long int blueN = k;
	long long int redN = n - blueN;
	
	for (long long int i = 1; i <= k; i++) {
		if (blueN < i || redN < i - 1) {
			cout << 0 << endl;
			continue;
		}
			
		long long int place = nCk(redN + 1, i);
		long long int num = nCk(blueN - 1, i - 1);
		
		
		cout << ((long long int)place * num) % (long long int)(pow(10, 9)+7) << endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:72: error: 'pow' was not declared in this scope
   39 |                 cout << ((long long int)place * num) % (long long int)(pow(10, 9)+7) << endl;
      |                                                                        ^~~
Language: C++

//おまじない
#include <bits/stdc++.h>
using namespace std;
 
long long int kai( long long int n){
  return (kai.at(n));}
  

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);}
    
  //k+2か所における、未知数ｋ＋２、右辺ｃ
  long long int b; 
  long long int c;//分配するときの個数
  long long int p; //両端以外で置く場所の選び方
  long long int w;
  for( int i=0; i<n;i++){
    b=i+1;
    c=n-k-i;
    p=(kai(k-1)/(kai(i)*kai(k-1-i)))%10000009 ;   // k-1Ci
    w=kai(k+c-1)/((kai(k+1)*kai(c)))%10000009;
    cout<<(p*w)%10000009<<endl;}
}
    
    
    
    


Compiler output:
a.cc: In function 'long long int kai(long long int)':
a.cc:6:15: error: request for member 'at' in 'kai', which is of non-class type 'long long int(long long int)'
    6 |   return (kai.at(n));}
      |               ^~
a.cc: In function 'int main()':
a.cc:27:11: error: no match for call to '(std::vector<int>) (long long int)'
   27 |     p=(kai(k-1)/(kai(i)*kai(k-1-i)))%10000009 ;   // k-1Ci
      |        ~~~^~~~~
a.cc:27:21: error: no match for call to '(std::vector<int>) (int&)'
   27 |     p=(kai(k-1)/(kai(i)*kai(k-1-i)))%10000009 ;   // k-1Ci
      |                  ~~~^~~
a.cc:27:28: error: no match for call to '(std::vector<int>) (long long int)'
   27 |     p=(kai(k-1)/(kai(i)*kai(k-1-i)))%10000009 ;   // k-1Ci
      |                         ~~~^~~~~~~
a.cc:28:10: error: no match for call to '(std::vector<int>) (long long int)'
   28 |     w=kai(k+c-1)/((kai(k+1)*kai(c)))%10000009;
      |       ~~~^~~~~~~
a.cc:28:23: error: no match for call to '(std::vector<int>) (long long int)'
   28 |     w=kai(k+c-1)/((kai(k+1)*kai(c)))%10000009;
      |                    ~~~^~~~~
a.cc:28:32: error: no match for call to '(std::vector<int>) (long long int&)'
   28 |     w=kai(k+c-1)/((kai(k+1)*kai(c)))%10000009;
      |                             ~~~^~~
Language: C++


#include <iostream>
#include <algorithm>
#include <functional>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;

uint64_t nCk(uint64_t n, uint64_t k) {
	uint64_t r = 1;
	for (uint64_t d = 1; d <= k; ++d) {
		r *= n--;
		r /= d;
	}
	return r;
}

int main()
{
	long long int n, k;
	cin >> n >> k;
	long long int blueN = k;
	long long int redN = n - blueN;
	
	for (int i = 1; i <= k; i++) {
		if (blueN < i || redN < (long long)i - 1) {
			cout << 0 << endl;
			continue;
		}
			
		int place = nCk(redN + 1, i);
		int num = nCk(blueN - 1, i - 1);
		
		
		cout << (place * num) % (long long int)(pow(10, 9)+7) << endl;
	}

	return 0;
}



Compiler output:
a.cc:13:1: error: 'uint64_t' does not name a type
   13 | uint64_t nCk(uint64_t n, uint64_t k) {
      | ^~~~~~~~
a.cc:10:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    9 | #include <map>
  +++ |+#include <cstdint>
   10 | 
a.cc: In function 'int main()':
a.cc:35:29: error: 'nCk' was not declared in this scope
   35 |                 int place = nCk(redN + 1, i);
      |                             ^~~
a.cc:39:57: error: 'pow' was not declared in this scope
   39 |                 cout << (place * num) % (long long int)(pow(10, 9)+7) << endl;
      |                                                         ^~~
Language: C++

import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		prepareFact();
		int num = sc.nextInt();
		int k = sc.nextInt();
		long dp[] = new long[2003];
		int a = num - k + 1;
		dp[1] = a;
		System.out.println(dp[1]);
		for(int i = 2; i <= k; i ++) {
			dp[i] = mod(dp[i - 1] * (a - i + 1));
			dp[i] = mod(dp[i] * invMod(i));
			System.out.println(mod(dp[i] * x_y(i, k, i)));
		}
	}

	static long MOD = (long)Math.pow(10, 9) + 7;
	public static long mod(long i) {
		return i % MOD + ((i % MOD) < 0 ? MOD : 0);
	}
	
	static long powerMod(long x, long y) {
		if (y == 0) {
			return 1;
		} else if (y == 1) {
			return x;
		} else if (y % 2 == 0) {
			long tmp = powerMod(x, y / 2);
			return mod(tmp * tmp);
		} else {
			long tmp = powerMod(x, y / 2);
			return mod(mod(tmp * tmp) * x);
		}
	}
	
	static long invMod(long x) {
		return powerMod(x, MOD - 2);
	}
	
	static int MAX_FACT = 20_100;
	static long factMod[] = new long[MAX_FACT];
	static void prepareFact() {
		factMod[0] = 1;
		for(int i = 1; i < MAX_FACT; i ++) {
			factMod[i] = mod(factMod[i - 1] * i);
		}
	}
	
	static long combiMod(int n, int r) {
		if(n < 0 || n < r) { return 0; }
		if(r == 0 || r == n) { return 1; }
		return mod(mod(factMod[n] * invMod(factMod[r])) * invMod(factMod[n - r]));
	}

	static long x_y(long a,long x,long y){
		if(x==y)return 1;
		else return mod(a*x_y(a,x,y+1));
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;

const ll M = 1000000007;

vector<ll> fac(300001); //n!(mod M)
vector<ll> ifac(300001); //k!^{M-2} (mod M)
//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 main(){
  int n, k;
  cin >> n >> k;
  fac[0] = 1;
  ifac[0] = 1;
  for(ll i = 0; i<300000; i++){
    fac[i+1] = fac[i]*(i+1) % M; // n!(mod M)
    ifac[i+1] = ifac[i]*mpow(i+1, M-2) % M; // k!^{M-2} (mod M) ←累乗にmpowを採用
  }
  for(int i=1; i<=k; i++){
    ll ans = (comb(k-1, i-1) % M) * (comb(n-k+1, i) % M)
    cout << ans << endl;
  }
  return 0;
}
  



Compiler output:
a.cc: In function 'int main()':
a.cc:40:5: error: expected ',' or ';' before 'cout'
   40 |     cout << ans << endl;
      |     ^~~~
Language: C++

#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#define int long long
#define mod 1000000007
using namespace std;

int factorial(long a) {
    long result = 1;
    long b;

    for(b = 1; b <= a; b++) {
        result *= b;
    }
    return result;
}

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

    for(int i=0; i<k; i++){
        long ans = factorial(n-k+1)/factorial(i)/factorial(n-k+1-1);
        ans *= factorial(k-1)/factorial(i)/factorial(k-i-1);
        ans %= mod;
        cout << ans << "\n";
    }
    
    return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long int;
constexpr ll MOD = 1000000007;
constexpr int MAX = 2001;
ll n, k;
ll 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(void) {
	cin >> n >> k;
	ll tmp = n - k + 1;
	vector<vector<ll>> v(n + 1, vector<ll>(n + 1, 0));
	COM();
	for (int i = 1; i <= k; i++) {
		ll ret = v[tmp][i]%MOD;
		ret = ret * v[k - 1][i - 1] % MOD;
		cout << ret << endl;
	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:12: error: too few arguments to function 'long long int COM(int, int)'
   34 |         COM();
      |         ~~~^~
a.cc:23:11: note: declared here
   23 | long long COM(int n, int k) {
      |           ^~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
#define LL long long
int main () {
  LL mod = 1e9 + 7;
  int N, K;
  cin >> N >> K;
  vector<vector<LL>>ncr(N + 1, vector<LL>(max(N - K, K) + 1));
  ncr[0][0] = 1;
  for (int i = 1; i <= N; i ++) {
    ncr[i][0] = 1;
    ncr[i][i] = 1;
    for (int j = 1; j < i; j ++) {
      ncr[i][j] = ncr[i - 1][j - 1] + ncr[i - 1][j];
      ncr %= mod;
    }
  }
  cout << N - K + 1 << endl;
  int t = N - K - 1;
  for (int i = 1; i < K; i ++) {
    LL k = ncr[t][i - 1] + ncr[t][i] * 2 + ncr[t][i + 1];
    k %= mod;
    k *= ncr[K - 1][i];
    k %= mod;
    cout << k << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: no match for 'operator%=' (operand types are 'std::vector<std::vector<long long int> >' and 'long long int')
   16 |       ncr %= mod;
      |       ~~~~^~~~~~
Language: C++

N, K = map(int, input().split())
from operator import mul
from functools import reduce
 
def nCr(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
 
for j in range(K):
  if (K+j)>N:
    print(0)
  else:
    x = (nCr((K-1), j) * nCr(N-K+1, j+1))
    if (x > (10**9+7)):
         print(x%(10**9+7))
    else:
         print(x)

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;

int kaijou();

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

  for (int i = 1; i < K + 1; i++) {
    ans = kaijou(N-K+1) / kaijou(i) / kaijou(N-K+1-i) * kaijou(K-1) / kaijou(i-1) / kaijou(K-i);
    ans /= (1000 * 1000 * 1000 + 7);
    cout << ans << endl;
  }
}

int kaijou(int n) {
  int x = 1;
  for (int i = 1; i < n + 1; i++) {
    x *= i;
  }
  return x;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: too many arguments to function 'int kaijou()'
   11 |     ans = kaijou(N-K+1) / kaijou(i) / kaijou(N-K+1-i) * kaijou(K-1) / kaijou(i-1) / kaijou(K-i);
      |           ~~~~~~^~~~~~~
a.cc:4:5: note: declared here
    4 | int kaijou();
      |     ^~~~~~
a.cc:11:33: error: too many arguments to function 'int kaijou()'
   11 |     ans = kaijou(N-K+1) / kaijou(i) / kaijou(N-K+1-i) * kaijou(K-1) / kaijou(i-1) / kaijou(K-i);
      |                           ~~~~~~^~~
a.cc:4:5: note: declared here
    4 | int kaijou();
      |     ^~~~~~
a.cc:11:45: error: too many arguments to function 'int kaijou()'
   11 |     ans = kaijou(N-K+1) / kaijou(i) / kaijou(N-K+1-i) * kaijou(K-1) / kaijou(i-1) / kaijou(K-i);
      |                                       ~~~~~~^~~~~~~~~
a.cc:4:5: note: declared here
    4 | int kaijou();
      |     ^~~~~~
a.cc:11:63: error: too many arguments to function 'int kaijou()'
   11 |     ans = kaijou(N-K+1) / kaijou(i) / kaijou(N-K+1-i) * kaijou(K-1) / kaijou(i-1) / kaijou(K-i);
      |                                                         ~~~~~~^~~~~
a.cc:4:5: note: declared here
    4 | int kaijou();
      |     ^~~~~~
a.cc:11:77: error: too many arguments to function 'int kaijou()'
   11 |     ans = kaijou(N-K+1) / kaijou(i) / kaijou(N-K+1-i) * kaijou(K-1) / kaijou(i-1) / kaijou(K-i);
      |                                                                       ~~~~~~^~~~~
a.cc:4:5: note: declared here
    4 | int kaijou();
      |     ^~~~~~
a.cc:11:91: error: too many arguments to function 'int kaijou()'
   11 |     ans = kaijou(N-K+1) / kaijou(i) / kaijou(N-K+1-i) * kaijou(K-1) / kaijou(i-1) / kaijou(K-i);
      |                                                                                     ~~~~~~^~~~~
a.cc:4:5: note: declared here
    4 | int kaijou();
      |     ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
const ll N=6666;
ll n,k,c[N][N];
ll dp[N],p[N];
ll C(ll n,ll m)
{
    if(c[n][m]) return c[n][m];
    if(m==0||n==m) return 1;
    if(m==1) return n;
    return c[n][m]=(C(n-1,m-1)+C(n-1,m))%mod;
}
int main()
{
    scanf("%d%d",&n,&k);
    ll s=n-k;
    p[0]=1;
    for(int i=1;i<=n;i++)
        p[i]=p[i-1]*i%mod;
    for(ll i=1;i<=s;i++)
        dp[i]=C(s-1,i-1)%mod;
    for(ll i=1;i<=k;i++)
    {
        ll ans=0;
        ans=(ans+C(k-1,i-1)*c(n-k+1,i))%mod;
        printf("%lld\n",(ans%mod+mod)%mod);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:30: error: 'c' cannot be used as a function
   27 |         ans=(ans+C(k-1,i-1)*c(n-k+1,i))%mod;
      |                             ~^~~~~~~~~
Language: C++

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

const int M = 1e9+7;

long long d[2010][2010];
long long combination(long long n, long long k) {
  if(~d[n][k]) return d[n][k];
  long long &res = d[n][k];
  if (n == k || k == 0)
    return res = 1;
  else {
    return res = combination(n - 1, k - 1) + combination(n - 1, k);
  }
}

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

  long long int ans;
  memset(d, d+2010*2010, -1);

  for(int i=1;i<=K;i++){
    if(N-K+1<i) ans = 0;
    else {
      ans = combination(N-K+1,i)%M * combination(K-1,i-1)%M;
    }
    cout << ans << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: invalid conversion from 'long long int (*)[2010]' to 'int' [-fpermissive]
   22 |   memset(d, d+2010*2010, -1);
      |             ~^~~~~~~~~~
      |              |
      |              long long int (*)[2010]
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:61:37: note:   initializing argument 2 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                                 ~~~~^~~
Language: C++

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

const int M = 1e9+7;

long long d[2010][2010];
long long combination(long long n, long long k) {
  if(~d[n][k]) return d[n][k];
  long long &res = d[n][k];
  if (n == k || k == 0)
    return res = 1;
  else {
    return res = combination(n - 1, k - 1) + combination(n - 1, k);
  }
}

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

  long long int ans;
  memset(d, d+N*N, -1);

  for(int i=1;i<=K;i++){
    if(N-K+1<i) ans = 0;
    else {
      ans = combination(N-K+1,i)%M * combination(K-1,i-1)%M;
    }
    cout << ans << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: invalid conversion from 'long long int (*)[2010]' to 'int' [-fpermissive]
   22 |   memset(d, d+N*N, -1);
      |             ~^~~~
      |              |
      |              long long int (*)[2010]
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:61:37: note:   initializing argument 2 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                                 ~~~~^~~
Language: C++

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

const int M = 1e9+7;

ll d[2010][2010];
long long combination(long long n, long long k) {
  if(~d[n][k]) return d[n][k];
  ll &res = d[n][k];
  if (n == k || k == 0)
    return res = 1;
  else {
    return res = combination(n - 1, k - 1) + combination(n - 1, k);
  }
}

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

  long long int ans;
  memset(d, d+N*N, -1);

  for(int i=1;i<=K;i++){
    if(N-K+1<i) ans = 0;
    else {
      ans = combination(N-K+1,i)%M * combination(K-1,i-1)%M;
    }
    cout << ans << endl;
  }
  return 0;
}


Compiler output:
a.cc:7:1: error: 'll' does not name a type
    7 | ll d[2010][2010];
      | ^~
a.cc: In function 'long long int combination(long long int, long long int)':
a.cc:9:7: error: 'd' was not declared in this scope
    9 |   if(~d[n][k]) return d[n][k];
      |       ^
a.cc:10:3: error: 'll' was not declared in this scope
   10 |   ll &res = d[n][k];
      |   ^~
a.cc:10:7: error: 'res' was not declared in this scope
   10 |   ll &res = d[n][k];
      |       ^~~
a.cc:10:13: error: 'd' was not declared in this scope
   10 |   ll &res = d[n][k];
      |             ^
a.cc: In function 'int main()':
a.cc:22:10: error: 'd' was not declared in this scope
   22 |   memset(d, d+N*N, -1);
      |          ^
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()
 
 
 
int main(void){
	ll N,K;
    cin >> N >> K;
    
    ll ans1 = N-K+1;
    ll ans2 = 1;
    ll ans;
    cout << ans1 << endl;
    for(ll i = 1; i<K; i++){
        ans1 = (ans1 * (N-K+1-i) * (i+1)^(MOD-2);
        ans2 = (ans2 * (K-i) * i^(MOD-2));
        ans1 = ans1%MOD;
        ans2 = ans2%MOD;
        ans = ans1*ans2;
        cout << ans%MOD << endl;
    }
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:49: error: expected ')' before ';' token
   37 |         ans1 = (ans1 * (N-K+1-i) * (i+1)^(MOD-2);
      |                ~                                ^
      |                                                 )
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
puts("THE WRITER HAVE NO PENIS OR ANUS OR BLADDER OR BRAIN.");
puts("THE WRITER IS A BABOON.")
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:32: error: expected ';' before 'return'
    6 | puts("THE WRITER IS A BABOON.")
      |                                ^
      |                                ;
    7 | return 0;
      | ~~~~~~
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: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 <bits/stdc++.h>

using namespace std;

#define MAX_N 2000

int N,K;
//int d[MAX_N];

//void quick_sort(int *v,int left,int right);
//void swap(int *v,int i,int j);
vector<vector<long long>> comb(int n, int r);

int main(){
  cin>>N>>K;
  for(int i=1;i<K+1;i++){
    vector<vector<long long>> c;
    c= comb(N-K+1,i);
    cout<<(c[N-K+1][i]%(1000000000+7))*(((k-i)^(c[N-K+1][i]))%(1000000000+7))%(1000000000+7)<<endl;
  }
  return 0;
}

vector<vector<long long>> comb(int n, int r)
{
  vector<vector<long long>> v(n + 1,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;
}
/*
void quick_sort(int *v,int left,int right)
{
  int i,last;
  if(left>=right)
    return;
  swap(v,left,(left+right)/2);
  last=left;
  for(i=left+1;i<=right;i++){
    if(v[i]<v[left]){//v[i]<v[left]------------------------------
      swap(v,++last,i);
    }
  }
  swap(v,left,last);
  quick_sort(v,left,last-1);
  quick_sort(v,last+1,right);
}

void swap(int *v,int i,int j)
{
  int temp;
  temp=v[i];
  v[i]=v[j];
  v[j]=temp;
}


*/


Compiler output:
a.cc: In function 'int main()':
a.cc:19:43: error: 'k' was not declared in this scope
   19 |     cout<<(c[N-K+1][i]%(1000000000+7))*(((k-i)^(c[N-K+1][i]))%(1000000000+7))%(1000000000+7)<<endl;
      |                                           ^