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

//
//  main.cpp
//  atcoderdemo
//
//  Created by apple on 2019/6/29.
//  Copyright © 2019 apple. All rights reserved.
//

#include <iostream>
#include <string.h>
#include <queue>
#define ll long long
using namespace std;
const int maxn = 1e5 + 5;
int a[maxn];
int sum[maxn];
int main(int argc, const char * argv[]) {
    int n;
    cin >> n;
    for(int i=1;i<=n;i++)
        cin >> a[i];
    sort(a+1,a+n+1);
    cout << a[n/2+1] - a[n/2];
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:22:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |     sort(a+1,a+n+1);
      |     ^~~~
      |     short
Language: C++

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

int a[100010];

int main() {
  #ifdef LOCAL
  freopen("input.txt", "r", stdin);
  #endif
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n & 1) {
    cout << 0;
    return;
  }
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  cout << a[n / 2] - a[n / 2 - 1];
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   15 |     return;
      |     ^~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> probs(n);
    for(int i=0;i<n; i++) 
        cin >> probs[i];
    
    sort(probs.begin(), probs.end());
    cout << probs[n/2] - probs[n/2-1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |     sort(probs.begin(), probs.end());
      |     ^~~~
      |     short
Language: C++

//#define NDEBUG
#include <cstddef>
#include <cstdint>
#include <vector>

namespace n91 {

using i8 = std::int_fast8_t;
using i32 = std::int_fast32_t;
using i64 = std::int_fast64_t;
using u8 = std::uint_fast8_t;
using u32 = std::uint_fast32_t;
using u64 = std::uint_fast64_t;
using isize = std::ptrdiff_t;
using usize = std::size_t;

constexpr usize operator"" _z(unsigned long long x) noexcept {
  return static_cast<usize>(x);
}

class rep {
  const usize f, l;

public:
  class itr {
    friend rep;
    usize i;
    constexpr itr(const usize x) noexcept : i(x) {}

  public:
    void operator++() noexcept { ++i; }
    constexpr usize operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
  };
  constexpr rep(const usize first, const usize last) noexcept
      : f(first), l(last) {}
  constexpr itr begin() const noexcept { return itr(f); }
  constexpr itr end() const noexcept { return itr(l); }
};
class revrep {
  const usize f, l;

public:
  class itr {
    friend revrep;
    usize i;
    constexpr itr(usize x) noexcept : i(x) {}

  public:
    void operator++() noexcept { --i; }
    constexpr usize operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
  };
  constexpr revrep(usize first, usize last) noexcept : f(--first), l(--last) {}
  constexpr itr begin() const noexcept { return itr(l); }
  constexpr itr end() const noexcept { return itr(f); }
};
template <class T> using vec_alias = std::vector<T>;
template <class T> auto md_vec(const usize n, const T &value) {
  return std::vector<T>(n, value);
}
template <class... Args> auto md_vec(const usize n, Args... args) {
  return std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
}
template <class T> constexpr T difference(const T &a, const T &b) {
  return a < b ? b - a : a - b;
}

} // namespace n91

#include <algorithm>
#include <array>
#include <iostream>
#include <string>
#include <utility>

namespace n91 {

void main_() {
  usize n;
  std::cin >> n;
  std::vector<u32> d(n);
  for (auto &e : p) {
    std::cin >> e;
  }
  std::sort(d.begin(), d.end());
  std::cout << d[n / 2_z] - d[n / 2_z - 1_z] << std::endl;
}

} // namespace n91

int main() {
  n91::main_();
  return 0;
}


Compiler output:
a.cc: In function 'void n91::main_()':
a.cc:83:18: error: 'p' was not declared in this scope
   83 |   for (auto &e : p) {
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
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;
}
ll combination(ll n, ll r) {
  if ( r * 2 > n ) r = n - r;
  uintmax_t dividend = 1;
  uintmax_t divisor  = 1;
  for ( ll i = 1; i <= r; ++i ) {
    dividend = dividend(n-i+1) % 1000000007;
    divisor  = divisor * i % 1000000007;
  }
  return dividend * modinv(divisor, 1000000007);
}


int main() {
   ll N, K;
   
   cin >> N >> K;
  
   for(ll i = 1; i <= K; i++) {
       cout << combination(N - K + 1, i) * combination(K - 1, i - 1) % 1000000007 << endl;
      
   }

   
   


    return 0;
}

Compiler output:
a.cc: In function 'll combination(ll, ll)':
a.cc:20:24: error: 'dividend' cannot be used as a function
   20 |     dividend = dividend(n-i+1) % 1000000007;
      |                ~~~~~~~~^~~~~~~
Language: C++

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

ll modpow(ll a, ll p) {
    if (p == 0)
        return 1;
    if (p % 2 == 0) {
            return modpow(a, p / 2) * modpow(a, p / 2) % 1000000007;
    } else
            return a * modpow(a, p - 1) % 1000000007;
    }
ll fermatComb(ll a, ll b) {
        if (b > a - b)
            return fermatComb(a, a - b);
        ll mul = 1; //分子
        ll div = 1; //分母
        for (int i = 0; i < b; i++) {
            mul *= (a - i);
            mul %= 1000000007;
            div *= (i + 1);
            div %= 1000000007;
        }
        ll ai = mul * modpow(div, 1000000007 - 2) % 1000000007; //フェルマーの小定理を利用して掛け算で計算
        return ai;
    }


int main() {
   ll N, K;
   
   cin >> N >> K;
   ll ans[K] = {0};
    ll sum = 0;
   for(ll i = 1; i <= K; i++) {
       ans[i - 1] = formatComb(N - K + 1, i) * formatComb(K - 1, i) % 1000000007;
      
   }

   for(ll i = 0; i < K; i++) {
       cout << ans[i] << endl;
   }
   
   


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:21: error: 'formatComb' was not declared in this scope; did you mean 'fermatComb'?
   36 |        ans[i - 1] = formatComb(N - K + 1, i) * formatComb(K - 1, i) % 1000000007;
      |                     ^~~~~~~~~~
      |                     fermatComb
Language: C++

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

ll modpow(ll a, ll p) {
    if (p == 0)
        return 1;
    if (p % 2 == 0) {
            return modpow(a, p / 2) * modpow(a, p / 2) % 1000000007;
    } else
            return a * modpow(a, p - 1) % 1000000007;
    }
ll fermatComb(ll a, ll b) {
        if (b > a - b)
            return fermatComb(a, a - b);
        ll mul = 1; //分子
        ll div = 1; //分母
        for (int i = 0; i < b; i++) {
            mul *= (a - i);
            mul %= 1000000007;
            div *= (i + 1);
            div %= 1000000007;
        }
        ll ai = mul * modpow(div, 1000000007 - 2) % 1000000007; //フェルマーの小定理を利用して掛け算で計算
        return ai;
    }


int main() {
   ll N, K;
   
   cin >> N >> K;
   ll ans[K] = {0};
    ll sum = 0;
   for(ll i = 1; i <= K; i++) {
       ans[i - 1] = fermatComb(N - K + 1, i) * formatComb(K - 1, i) % 1000000007;
      
   }

   for(ll i = 0; i < K; i++) {
       cout << ans[i] << endl;
   }
   
   


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:48: error: 'formatComb' was not declared in this scope; did you mean 'fermatComb'?
   36 |        ans[i - 1] = fermatComb(N - K + 1, i) * formatComb(K - 1, i) % 1000000007;
      |                                                ^~~~~~~~~~
      |                                                fermatComb
Language: C++

#include <bits/stdc++.h>
using namespace std ;
#define ll long long
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
int mod=1e9+7;

//RepeatSquare
ll RS(ll N ,ll P, ll M){
    if(P==0) return 1;
    else if(P%2==0){
        ll t=RS(N,P/2,M);
        return t*t%M;
    }
    else return N*RS(N,P-1,M)%mod;   
}
//combination
ll f[10010],inv[10010];

void init(){
    f[0]=1;
    for(int i=1;i<10010;i++){
        f[i]=f[i-1]*i%mod;
        inv[i]=RS(f[i],mod-2);
    } 
}

ll comb(ll a,ll b){
    if(b>a) return 0;
    else return ((f[a]*inv[b]) % mod *inv[a-b])% mod;
}

int main(){
    init();
    ll N,K;cin>>N>>K;
    for(int i=1;i<=K;i++){
        ll t =comb(K-1,i-1)*comb(N-K+1,i)%mod;
        //cout << t <<endl;
    } 
    cout << f[2000] << endl;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:24:18: error: too few arguments to function 'long long int RS(long long int, long long int, long long int)'
   24 |         inv[i]=RS(f[i],mod-2);
      |                ~~^~~~~~~~~~~~
a.cc:9:4: note: declared here
    9 | ll RS(ll N ,ll P, ll M){
      |    ^~
Language: C++

#include <iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#define MOD 1000000007
#define MAX 2010
#define ll long long
using namespace std;


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;
}

ll COM(int n, int r){
    
    if(n<r || n<0 || r<0)
        return 0;
    
    return (fac[n]*(finv[r]*finv[n-r])%MOD)%MOD;
}
int main(void){
    // Your code here!
    ComInit();   
    ll n,k;
    cin>>n>>k;


for(int i=1;i<=k;i++){
    ll a= n-k+1;
    cout<< COM(a,i)*COM(k-1, i-1)%MOD<<endl;
    
}

    
}


Compiler output:
a.cc: In function 'void ComInit()':
a.cc:24:21: error: a function-definition is not allowed here before '{' token
   24 | ll COM(int n, int r){
      |                     ^
a.cc:31:15: error: a function-definition is not allowed here before '{' token
   31 | int main(void){
      |               ^
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:13:15: note: to match this '{'
   13 | void ComInit(){
      |               ^
Language: C++

const int mod = 1'000'000'007;
const int size_max = 200001;

long long fac[size_max], finv[size_max];

long long mpow(long long a, long long b);
void com_init();
long long com(long long n, long long k);

long long mpow(long long a, long long b)
{
	long long t = a;
	long long ans = 1;
	for (int i = 0; b != 0; i++) {
		if ((b & 1) == 1) {
			ans *= t;
			ans %= mod;
		}
		t *= t;
		t %= mod;
		b >>= 1;
	}

	return ans;
}

void com_init()
{
	fac[0] = fac[1] = 1;

	for (int i = 2; i < size_max; i++) {
		fac[i] = fac[i - 1] * i;
		fac[i] %= mod;
	}

	finv[size_max - 1] = mpow(fac[size_max - 1], mod - 2);

	for (int i = size_max - 2; i >= 2;i--) {
		finv[i] = finv[i + 1] * (i + 1) % mod;
	}
	finv[0] = finv[1] = 1;
}

long long com(long long n, long long k)
{
	if (n < k) {
		return 0;
	}

	if (n < 0 || k < 0) {
		return 0;
	}

	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++


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

MAX = 2100
MOD = 1000000007

fac = [0] * MAX
finv = [0] * MAX
inv = [0] * MAX

fac[0] = 1
fac[1] = 1
finv[0] = 1
finv[1] = 1
inv[1] = 1

for i in range(2, MAX):
    fac[i] = fac[i - 1] * i % MOD
    inv[i] = MOD - inv[MOD % i] * int(MOD / i) % MOD #ここintいるっぽい
    finv[i] = finv[i - 1] * inv[i] % MOD
    
#print(fac)
#print(inv)
#print(finv)
    
def COM(n, k):
    if n < k:
        return 0
    if (n < 0) or (k < 0):
        return 0
    #print(fac[n])
    #print(finv[k])
    #print(finv[n - k])
    #print(finv[k] * finv[n - k] % MOD)
    #print(fac[n] * (finv[k] * finv[n - k] % MOD))
    #print(fac[n] * (finv[k] * finv[n - k] % MOD) % MOD)
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD

for i in range(1, K+1):
    #print("@")
    #print(N-K+1, i, K-1, i-1)
    print(COM(N-K+1, i) * COM(K-1, i-1))
    #print("¥")

Compiler output:
a.cc:19:54: error: stray '#' in program
   19 |     inv[i] = MOD - inv[MOD % i] * int(MOD / i) % MOD #ここintいるっぽい
      |                                                      ^
a.cc:22:2: error: invalid preprocessing directive #print
   22 | #print(fac)
      |  ^~~~~
a.cc:23:2: error: invalid preprocessing directive #print
   23 | #print(inv)
      |  ^~~~~
a.cc:24:2: error: invalid preprocessing directive #print
   24 | #print(finv)
      |  ^~~~~
a.cc:31:6: error: invalid preprocessing directive #print
   31 |     #print(fac[n])
      |      ^~~~~
a.cc:32:6: error: invalid preprocessing directive #print
   32 |     #print(finv[k])
      |      ^~~~~
a.cc:33:6: error: invalid preprocessing directive #print
   33 |     #print(finv[n - k])
      |      ^~~~~
a.cc:34:6: error: invalid preprocessing directive #print
   34 |     #print(finv[k] * finv[n - k] % MOD)
      |      ^~~~~
a.cc:35:6: error: invalid preprocessing directive #print
   35 |     #print(fac[n] * (finv[k] * finv[n - k] % MOD))
      |      ^~~~~
a.cc:36:6: error: invalid preprocessing directive #print
   36 |     #print(fac[n] * (finv[k] * finv[n - k] % MOD) % MOD)
      |      ^~~~~
a.cc:40:6: error: invalid preprocessing directive #print
   40 |     #print("@")
      |      ^~~~~
a.cc:41:6: error: invalid preprocessing directive #print
   41 |     #print(N-K+1, i, K-1, i-1)
      |      ^~~~~
a.cc:43:6: error: invalid preprocessing directive #print
   43 |     #print("¥")
      |      ^~~~~
a.cc:2:1: error: 'N' does not name a type
    2 | N, K = map(int, input().split())
      | ^
Language: C

#include<bits/stdc++.h>
constexpr long long MOD = 1'000'000'007; //'

long long n,k;
long long comb (long long t, int r) {
    //--------Valid Error------------------
    if (t<0 || r<0) assert(false);
    if (t < r) return 0;
    //-------------------------------------

    r = std::min(r, t-r);
    if(r==0) return 1LL;
    if(r==1) return t;

    long long retVal = 1LL;
    for (long long i=0LL; i<r; ++i) {
        long long p = retVal * (long long)(t-i);
        retVal = (long long)(p % MOD); // retVal = n! / (n-r)!
        retVal /= (i+1LL); // retVal /= r!
    }
    return retVal;
}

long long solve(int i){
    long long t = (long long)comb(k-1, i-1) * (long long)comb(n-k+1,i);
    return t%MOD;
}

int main(){
    std::cin >> n >> k;
    for(int i=1; i<=k; ++i){
        std::cout << solve(i) << std::endl;
    }
    return 0;
}

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

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

int main() {
    int n,k;cin>>n>>k;
    int mod=1e9+7;
    int c[2000][2000];
    for (int i=0;i<2000;i++)
        c[i][0]=c[i][i]=1;
    for (int i=2;i<2000;i++)
        for (int j=1;j<i;j++)
            c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod;
    for (int i=1;i<=k;i++)
        cout<<((n-k+1<i?0:(ll)c[n-k+1][i])*c[k-1][i-1]%mod<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:59: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   15 |         cout<<((n-k+1<i?0:(ll)c[n-k+1][i])*c[k-1][i-1]%mod<<endl;
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:15:65: error: expected ')' before ';' token
   15 |         cout<<((n-k+1<i?0:(ll)c[n-k+1][i])*c[k-1][i-1]%mod<<endl;
      |               ~                                                 ^
      |                                                                 )
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;

LL fact[1e5], finv[1e5], inv[1e5];

void ComInit(int N) {
//  fact = vector<LL>(N + 1);
//  inv = vector<LL>(N + 1);
//  finv = vector<LL>(N + 1);
  fact[0] = fact[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i <= N; i++){
    fact[i] = fact[i-1] * i % kMod;
    inv[i] = kMod - inv[kMod % i] * (kMod / i) % kMod;
    finv[i] = finv[i-1] * inv[i] % kMod;
  }
}

LL nCr(int n, int r) {
  LL numerator = fact[n];
  LL denominator = finv[r] * finv[n-r] % kMod;
  return (numerator * denominator) % kMod;
}

int main() {
  int N, K; std::cin >> N >> K;
  ComInit(5e4);
  for (int k = 1; k <= K; ++k) {
    std::cout << nCr(N - K + 1, k) * nCr(K - 1,  k - 1) % kMod << std::endl;
  }
}


Compiler output:
a.cc:19:9: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   19 | LL fact[1e5], finv[1e5], inv[1e5];
      |         ^~~
a.cc:19:9: error: could not convert '1.0e+5' from 'double' to 'long unsigned int'
   19 | LL fact[1e5], finv[1e5], inv[1e5];
      |         ^~~
      |         |
      |         double
a.cc:19:9: error: size of array 'fact' has non-integral type 'double'
a.cc:19:20: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   19 | LL fact[1e5], finv[1e5], inv[1e5];
      |                    ^~~
a.cc:19:20: error: could not convert '1.0e+5' from 'double' to 'long unsigned int'
   19 | LL fact[1e5], finv[1e5], inv[1e5];
      |                    ^~~
      |                    |
      |                    double
a.cc:19:20: error: size of array 'finv' has non-integral type 'double'
a.cc:19:30: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   19 | LL fact[1e5], finv[1e5], inv[1e5];
      |                              ^~~
a.cc:19:30: error: could not convert '1.0e+5' from 'double' to 'long unsigned int'
   19 | LL fact[1e5], finv[1e5], inv[1e5];
      |                              ^~~
      |                              |
      |                              double
a.cc:19:30: error: size of array 'inv' has non-integral type 'double'
Language: C++

#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<iterator>
#include<cmath>
#include<string>
#include<algorithm>
#include<sstream>
#include<queue>
#include<list>
#include<deque>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<chrono>
#include<iomanip>

/*  auto start = high_resolution_clock::now();
auto stop = high_resolution_clock::now();
auto duration = duration_cast<milliseconds>(stop - start);
pr(duration.count());    */


#define FastIO      ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define pb          push_back
#define siz         100009
#define mp          make_pair
#define ll          long long int
#define fileout     freopen("output.txt","w",stdout)
#define filein      freopen("input.txt","r",stdin)
#define pi          acos(-1.0)
#define all(x)      x.begin(),x.end()
#define ull		    unsigned long long int
#define m(a)	    memset(a,0,sizeof(a))
#define f(i,n)	    for(ll i=0;i<n;i++)
#define sc(a)	    scanf("%lld",&a)
#define pr(a)	    printf("%lld\n",a)
const ll inf = 1000000007;
using namespace std;
//using namespace chrono;'
ll exgcd(ll a, ll b, ll * c, ll * d)
{
	if (a == 0)//x = (((x % m) + m) % m);[this part must be done]
	{
		*c = 0;
		*d = 1;
		return b;
	}
	ll x, y;
	ll gcd = exgcd(b % a, a, &x, &y);
	*c = y - (b / a) * x;
	*d = x;
	return gcd;
}
int main()
{
	FastIO;
	ll a, i, t, m, j, k, b,x,y, n,f[300];
	cin >> n >> k;
	n = n - k +1;
	a = 1;
	for (i = 1; i <= k; i++)
	{
		ll tmp = exgcd(i, inf, &x, &y);
		x = (((x % inf) + inf) % inf);
		a = ((a * (n-i+1)) % inf * x) % inf));
		if (i == 1 || i==k)
			cout << a << endl;
		else 
		{
			tmp = exgcd(i - 1, inf, &x, &y);
			x = (((x % inf) + inf) % inf);
			cout << ((a * (k - i+1)) % inf * x) % inf << endl;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:67:52: error: expected ';' before ')' token
   67 |                 a = ((a * (n-i+1)) % inf * x) % inf));
      |                                                    ^
      |                                                    ;
Language: C++

#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N = 4e3 + 5, mod = 1e9 + 7;
int n, k, p[N][N];
int add(int a, int b){
    return (a + b) % mod;
}
int mul(int a, int b){
    return (1ll * a * b) % mod;
}
void pascal(){
    for(int i = 0; i < N; i++)
        for(int j = 0; j <= i; j++)
            p[i][j] = ((j)? add(p[i - 1][j - 1] , p[i - 1][j]) : 1);
}
int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    pascal();
    cin >> n >> k;
    pre();
    for(int i = 1; i <= k; i++)
        cout << mul(p[n - k + 1][i], p[k - 1][i - 1]) << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'pre' was not declared in this scope; did you mean 'pread'?
   24 |     pre();
      |     ^~~
      |     pread
Language: C++

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

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using ll = long long;

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007LL;

ll pow(ll a, ll n, ll m) {
	ll ret = 1LL;
	for (; n > 0LL; n >>= 1LL, a = a * a % m) {
		if (n % 2LL == 1LL) {
			ret = ret * a % m;
		}
	}
	return ret;
}

ll cmbination(ll x, ll y){
  if(y>x) return 0LL;
  ll c = 1LL;
  for(ll i = 0LL; i < y; i++){
    c *= (x-i)%mod;
    c %= mod;
    c*= pow(i+1,mod-2,mod);
    c%=mod;
  }
  return c;
}

int main() {
  ll N, K;
  cin >> N >> K;
  for(ll i = 1LL; i < K; i++) {
    cout<<((combination(K-1,i-1)*combination(N-K+1,i))%mod) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:13: error: 'combination' was not declared in this scope; did you mean 'cmbination'?
   39 |     cout<<((combination(K-1,i-1)*combination(N-K+1,i))%mod) << endl;
      |             ^~~~~~~~~~~
      |             cmbination
Language: C++

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

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using ll = long long;

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const mod = 1000000007LL;

ll pow(ll a, ll n, ll m) {
	ll ret = 1LL;
	for (; n > 0LL; n >>= 1LL, a = a * a % m) {
		if (n % 2LL == 1LL) {
			ret = ret * a % m;
		}
	}
	return ret;
}

ll cmbination(ll x; ll y){
  if(y>x) return 0LL;
  ll c = 1LL;
  for(ll i = 0LL; i < y; i++){
    c *= (x-i)%mod;
    c %= mod;
    c*= pow(i+1,mod-2,mod);
    c%=mod;
  }
  return c;
}

int main() {
  ll N, K;
  cin >> N >> K;
  for(ll i = 1LL; i < K; i++) {
    cout<<((combination(K-1,i-1)*combination(N-K+1,i))%mod) << endl;
  }
}

Compiler output:
a.cc:11:7: error: 'mod' does not name a type
   11 | const mod = 1000000007LL;
      |       ^~~
a.cc:23:19: error: expected ')' before ';' token
   23 | ll cmbination(ll x; ll y){
      |              ~    ^
      |                   )
a.cc:23:25: error: expected initializer before ')' token
   23 | ll cmbination(ll x; ll y){
      |                         ^
a.cc: In function 'int main()':
a.cc:39:13: error: 'combination' was not declared in this scope; did you mean 'cmbination'?
   39 |     cout<<((combination(K-1,i-1)*combination(N-K+1,i))%mod) << endl;
      |             ^~~~~~~~~~~
      |             cmbination
a.cc:39:56: error: 'mod' was not declared in this scope; did you mean 'modf'?
   39 |     cout<<((combination(K-1,i-1)*combination(N-K+1,i))%mod) << endl;
      |                                                        ^~~
      |                                                        modf
Language: C++

#include <iostream>
#include <iomanip>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <fstream>

#define mod 1000000007
#define point complex <double>
#define p pair<double,double>
#define ll long long
#define pi acos(-1)

using namespace std;

ll fact[2005], inv[2005], dp[2005][2005][2];

ll fp(int base, int power)
{
	if (power == 0) return 1;
	ll ans = fp(base, power / 2);
	ans = (ans * ans) % mod;
	if (power % 2 != 0) ans = (ans * (base % mod)) % mod;
	return ans;
}

void calc()
{
	fact[0] = inv[0] = 1;
	for (ll i = 1; i <= 2000; i++)
	{
		fact[i] = (i * fact[i - 1]) % mod;
		inv[i] = fp(fact[i], mod - 2);
	}
}

ll ncr(int n, int r)
{
	return ((fact[n] * inv[r]) % mod * inv[n - r]) % mod;
}

ll stars_and_bars(int stars, int bars)
{
	return ncr(stars - 1, bars - 1);
}

// states: consecutive_blue cnt , all left red cnt , flag if prev is blue or not 

ll solve(int blue, int red, bool prev)
{
	if (!red && !blue) return 1;
	if (dp[blue][red][prev] != -1)return dp[blue][red][prev];
	ll ans = 0;
	if (blue && !prev) ans = (ans + solve(blue - 1, red, true)) % mod;
	if (red) ans = (ans + solve(blue, red - 1, false)) % mod;
	return dp[blue][red][prev] = ans;
}

int main()
{
	calc();
	memset(dp, -1, sizeof dp);
	int n, k, r;
	cin >> n >> k;
	for (int i = 1; i <= k; i++)
		cout << (stars_and_bars(k, i) * solve(i, n - k, 0)) % mod << '\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:9: error: 'memset' was not declared in this scope
   64 |         memset(dp, -1, sizeof dp);
      |         ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <fstream>
  +++ |+#include <cstring>
    9 |
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define pb push_back
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define endl '\n'
#define ll long long
#define f first
#define s second
#define FAST cin.tie(0), cout.tie(0), ios::sync_with_stdio(0)
#define debug(x) cout << "DEBUG " << x << endl
#define debug2(x, y) cout << "DEBUG " << x << " " << y << endl
#define debug3(x, y, z) cout << "DEBUG " << x << " " << y << " " << z<< endl
#define debug4(x, y, z, o) cout << "DEBUG " << x << " " << y << " " << z<< " " << o << endl
using namespace std;
typedef pair<ll, ll> pii;
typedef vector<vector<ll>> mat;
const ll MOD = 1e9+7;
const int MAXN = 1e5+5;

ll fat[MAXN];

ll expo(ll a, ll b){
    if(b == 0) 
		return 1;
    ll x = expo(a, b/2);
    return (b & 1 ? ((x*x)%MOD*a)%MOD : (x*x) % MOD);
}
 
ll c(ll n, ll k) {
	if(n-k < 0) return 0;
	if(k == n) return 1;
	
	ll res = (fat[n]*expo(fat[k], MOD-2))%MOD;
	return (res*expo(fat[n-k], MOD-2))%MOD;
}

int main() {
	int n, k;
	cin >> n >> k;
	fat[0] = inv[0] = 1;
	for(int i = 1; i <= n; i++) 
		fat[i] = (fat[i-1]*i)%MOD;
	
	ll red = n-k;
	
	
	for(int i = 1; i <= k; i++) 
		cout << (c(k-1, k-i) * c(i+red-(i-1), red-(i-1) ))%MOD << endl; 
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:18: error: 'inv' was not declared in this scope; did you mean 'int'?
   41 |         fat[0] = inv[0] = 1;
      |                  ^~~
      |                  int
Language: C++

#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<iterator>
#include<cmath>
#include<string>
#include<algorithm>
#include<sstream>
#include<queue>
#include<list>
#include<deque>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<chrono>


/*  auto start = high_resolution_clock::now();
auto stop = high_resolution_clock::now();
auto duration = duration_cast<milliseconds>(stop - start);
pr(duration.count());    */


#define FastIO      ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define pb          push_back
#define siz         100009
#define mp          make_pair
#define ll          long long int
#define inf         1000000007
#define fileout     freopen("output.txt","w",stdout)
#define filein      freopen("input.txt","r",stdin)
#define pi          acos(-1.0)
#define all(x)      x.begin(),x.end()
#define ull		    unsigned long long int
#define m(a)	    memset(a,0,sizeof(a))
#define f(i,n)	    for(ll i=0;i<n;i++)
#define sc(a)	    scanf("%lld",&a)
#define pr(a)	    printf("%lld\n",a)
using namespace std;
//using namespace chrono;'
int main()
{
	FastIO;
	ll a, i,t, j, k,b, n,dp[2005][2005];
	cin >> n >> k;
	m(dp);
	n = n - k + 1;
	dp[0][0] = 1;
	for (i = 1; i <= n; i++)
	{
		for (j = 0; j <= i+1; j++)
		{
			if (j == 0)
			{
				dp[i][j] = dp[i - 1][j]%inf;
			}
			else
				dp[i][j] = (dp[i - 1][j - 1]%inf + dp[i - 1][j]%inf) % inf;
		}
	}
	for (i = 1; i <= k; i++)
	{
		cout << ((dp[n][i] )%inf * (dp[k - 1][i - 1]) %inf))%inf << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:68: error: expected ';' before ')' token
   64 |                 cout << ((dp[n][i] )%inf * (dp[k - 1][i - 1]) %inf))%inf << endl;
      |                                                                    ^
      |                                                                    ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
#define Q int t; scanf("%d", &t); for(int q=1; q<=t; q++)
typedef long long int lli;
typedef pair<lli, lli> pi;
 
lli fac[2002], inv[2002], mod = 1000000007;
 
lli bigmod(lli a, lli b, lli m)
{
    lli gg = a%m;
    lli ret = 1;
    while(b){
        if(b%2){
            ret = (ret*gg) % m;
        }
        gg = (gg*gg) % m;
        b/=2;
    }
    return ret;
}
 
lli ncr(lli n, lli r)
{
    if(r > n) return 0LL;
    lli ret;
    ret = (fac[n]*inv[r]) % mod;
    ret = (ret*inv[n-r]) % mod;
    return ret;
}
 
int main()
{
    fac[0] = 1;
    inv[0] = bigmod(1, mod-2, mod);
    for(lli i=1; i<=2001; i++){
        fac[i] = (i*fac[i-1]) % mod;
        inv[i] = bigmod(fac[i], mod-2, mod);
    }
    lli n, k;
    cin >> n >> k;
    lli x = n-k+1;
    for(lli i=1; i<=k; i++){
        if(i == 1LL){
            cout << ncr(x, i) << "\n";
        }
        else{
            cout << ncr(k-1)(i-1)*ncr(x, i)%mod << "\n";
        }
    }
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:24: error: too few arguments to function 'lli ncr(lli, lli)'
   49 |             cout << ncr(k-1)(i-1)*ncr(x, i)%mod << "\n";
      |                     ~~~^~~~~
a.cc:24:5: note: declared here
   24 | lli ncr(lli n, lli r)
      |     ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <string>
#include <iomanip>
using namespace std;
long long mod=1e9+7;
struct all{
	vector<long long> kai,gya,nck;
	all(long long n){
		kai.resize(n+1);
		gya.resize(n+1);
		nck.resize(n+1);
	}
	long long pow(long long x,long long n){
		long long ret=1;
		if(n>0){
			ret=pow(x,n/2);
			if(n%2==0){
				(ret=(ret*ret))%=mod;
			}else{
				(ret=((ret*ret)%mod)*x)%=mod;
			}
		}
		return ret;
	}
	long long inv(long long n){
		return pow(n,mod-2);
	}
	vector<long long> cul(long long n){
		kai[n]=n;
		for(int i=n-1;i>0;i--){
			(kai[i]=kai[i+1]*i)%=mod;
		}
		gya[1]=inv(1);
		for(int i=2;i<=n;i++){
			(gya[i]=gya[i-1]*inv(i))%=mod;
		}
		for(int i=1;i<=n;i++){
			(nck[i]=kai[n+1-i]*gya[i])%=mod;
		}
		nck[0]=1;
		nck[n]=1;
		return nck;
	}
};
int main(){
	int n,k;
	cin>>n>>k;
	all nii;
	vector<long long> a=nii.cul(n-k+1);
	vector<long long> b=nii.cul(k-1);
	for(int i=1;i<=k;i++){
		cout<<a[i]*b[i-1]%mod<<endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:13: error: no matching function for call to 'all::all()'
   53 |         all nii;
      |             ^~~
a.cc:13:9: note: candidate: 'all::all(long long int)'
   13 |         all(long long n){
      |         ^~~
a.cc:13:9: note:   candidate expects 1 argument, 0 provided
a.cc:11:8: note: candidate: 'all::all(const all&)'
   11 | struct all{
      |        ^~~
a.cc:11:8: note:   candidate expects 1 argument, 0 provided
a.cc:11:8: note: candidate: 'all::all(all&&)'
a.cc:11:8: note:   candidate expects 1 argument, 0 provided
Language: Java

public class Main {
 static int i;//i:蓝球连续排列的个数(s:红球连续排列的个数）
 static long res=0;
 static long M=1000000007;
 public static void main(String []args) {
  Scanner sc=new Scanner();
   int n=sc.nextInt();
   int k=sc.nextInt();
   balls(n,k);
 }
 //排序方法一共有n!/(k!*(n-k)!)
 
 public static long balls(int n,int k) {
   for(i=1;i<=k;i++) {
   if(n==2*k) {
    if(i==1|| (i-1)==k || i==k) {
        res=n-k+1;
        System.out.println(res%M);
       }
    else {
        res=2*comb(k-1,i-1)*comb(n-k-1,i-1)+comb(k-1,i-1)*comb(n-k-1,i)+comb(k-1,i-1)*comb(n-k-1,i-2);
        System.out.println(res%M);
       }    
   }
   if(n>2*k) {
    if(i==1|| (i-1)==k) {
        res=n-k+1;
        System.out.println(res%M);
       }
    else {
        res=2*comb(k-1,i-1)*comb(n-k-1,i-1)+comb(k-1,i-1)*comb(n-k-1,i)+comb(k-1,i-1)*comb(n-k-1,i-2);
        System.out.println(res%M);
       }
   }
   if(n<2*k) {
    if(i==1) {
        res=n-k+1;
     System.out.println(res%M);
    }
    else if(i!=k){
        res=2*comb(k-1,i-1)*comb(n-k-1,i-1)+comb(k-1,i-1)*comb(n-k-1,i);
        System.out.println(res%M);
     }
    else {
     res=comb(k-1,i-1)*comb(n-k-1,i);
     System.out.println(res%M);
    }
       }
   }
   return res;
 }
//i==s:排列方式有2*comb(k-1,i-1)*comb(n-k-1,i-1)
//i==s-1ori==s+1:排列方式有comb(k-1,i-1)*comb(n-k-1,i-1)
 
 
/*
 * 11 12 11
 * 22 21 22 22 22 21
 * 32
 */

 public static long comb(int n,int k) {
  int i,j;
  if(n>=2*k) {
   i=n-k+1;
   j=k;
  }
  else {
   i=k+1;
   j=n-k;
  }
  return (pf(i,n)/pf(1,j))%M;
 }
 
 static long pf(int m,int n) {
  long i,f;
  f=1;
  for(i=m;i<=n;i++) {
   f=(f*i)%M;
  }
  return f;
 }
}


Compiler output:
Main.java:6: error: cannot find symbol
  Scanner sc=new Scanner();
  ^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
  Scanner sc=new Scanner();
                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

 class balls Main{
 static int i;//i:蓝球连续排列的个数(s:红球连续排列的个数）
 static long res=0;
 static long M=1000000007;
 public static void main(String []args) {
  balls(2000,6);
 }
 //排序方法一共有n!/(k!*(n-k)!)
 
 public static long balls(int n,int k) {
   for(i=1;i<=k;i++) {
   if(n==2*k) {
    if(i==1|| (i-1)==k || i==k) {
        res=n-k+1;
        System.out.println(res%M);
       }
    else {
        res=2*comb(k-1,i-1)*comb(n-k-1,i-1)+comb(k-1,i-1)*comb(n-k-1,i)+comb(k-1,i-1)*comb(n-k-1,i-2);
        System.out.println(res%M);
       }    
   }
   if(n>2*k) {
    if(i==1|| (i-1)==k) {
        res=n-k+1;
        System.out.println(res%M);
       }
    else {
        res=2*comb(k-1,i-1)*comb(n-k-1,i-1)+comb(k-1,i-1)*comb(n-k-1,i)+comb(k-1,i-1)*comb(n-k-1,i-2);
        System.out.println(res%M);
       }
   }
   if(n<2*k) {
    if(i==1) {
        res=n-k+1;
     System.out.println(res%M);
    }
    else if(i!=k){
        res=2*comb(k-1,i-1)*comb(n-k-1,i-1)+comb(k-1,i-1)*comb(n-k-1,i);
        System.out.println(res%M);
     }
    else {
     res=comb(k-1,i-1)*comb(n-k-1,i);
     System.out.println(res%M);
    }
       }
   }
   return res;
 }
//i==s:排列方式有2*comb(k-1,i-1)*comb(n-k-1,i-1)
//i==s-1ori==s+1:排列方式有comb(k-1,i-1)*comb(n-k-1,i-1)
 
 
/*
 * 11 12 11
 * 22 21 22 22 22 21
 * 32
 */

 public static long comb(int n,int k) {
  int i,j;
  if(n>=2*k) {
   i=n-k+1;
   j=k;
  }
  else {
   i=k+1;
   j=n-k;
  }
  return (pf(i,n)/pf(1,j))%M;
 }
 
 static long pf(int m,int n) {
  long i,f;
  f=1;
  for(i=m;i<=n;i++) {
   f=(f*i)%M;
  }
  return f;
 }
}

Compiler output:
Main.java:1: error: '{' expected
 class balls Main{
            ^
1 error
Language: C++

#include <bits/stdc++.h>
#include<cmath>
#include<cstring>
#define pb push_back
#define pi acos(-1.0)
#define loop(i,a,n) for(int i=a;i<n;i++)
#define rloop(i,a,n) for(int i=n;i>=a;i--)
#define ff first
#define ss second
#define sc1(a) scanf("%d",&a)
#define sc2(a,b) scanf("%d %d",&a,&b)
#define sc3(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/(gcd(a,b))
#define ms(a,b) memset(a,b,sizeof a)
#define check cout<<"HI"<<endl;

using namespace std;

long long int C[r+1]={0};
long long int nCrModp(int n,int r, long long int p)
{
    
    memset(C, 0, sizeof(C));

    C[0] = 1;
    for (int i = 1; i <= n; i++)
    {

        for (int j = min(i, r); j > 0; j--){
//check;
            C[j] = (C[j] + C[j-1])%p;}
    }
    return C[r];
}

int main()
{
    int n ,k,m ;
    sc2(n,k);
    m=n-k+1;
    cout<<m<<endl;
    loop(i,2,k+1){
    cout <<(nCrModp(m, i, 1000000007)*nCrModp((k-1),(i-1),1000000007))%1000000007<<endl;
    }//cout <<nCrModp(m, k, 1000000007)<<endl;

    return 0;
}
;









Compiler output:
a.cc:21:17: error: 'r' was not declared in this scope
   21 | long long int C[r+1]={0};
      |                 ^
a.cc: In function 'long long int nCrModp(int, int, long long int)':
a.cc:25:12: error: 'C' was not declared in this scope
   25 |     memset(C, 0, sizeof(C));
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int MOD = 1000000007;
ll mpow(ll x, ll n){
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % MOD;
        x = x*x % MOD;
        n = n >> 1;
    }
    return ans;
}
ll kj(ll x){
    ll s = 1;
    for(ll i = 1; i <= x; i++){
        s = s * i % MOD;
    }
    return s;
}
ll combination(ll a, ll b){
    if(a == 0 && b == 0) return 1;
    if(a < b || a < 0) return 0;
    return (kj(a) * mpow(kj(b), MOD-2) % MOD) * mpow(kj(a-b), MOD-2) % MOD;
}


int main(){
    int N,K;
    cin >> N >> K;
    int Sepa;
    for(int i=1; i <= K; i++){
            cout <<  combination(N-K+1,i) % MOD * combination(K-1,i-1) % MOD << endl;
        }
    }
}


Compiler output:
a.cc:37:1: error: expected declaration before '}' token
   37 | }
      | ^
Language: C++

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

ll combination(ll n, ll r) {
  if ( r * 2 > n ) r = n - r;
  ll dividend = 1;
  ll divisor  = 1;
  for ( unsigned int i = 1; i <= r; ++i ) {
    dividend *= (n-i+1);
    divisor  *= i;
  }
  return dividend / divisor;
}


int main(){
    int N,K;
    cin >> N >> K;
    int Sepa;
    if(N-K+1 <= K){
        Sepa = N-K+1
    }else{
        Sepa = K;
    }
    for(int i=1; i < Sepa+1; i++){
        cout <<  combination(N-K+1,i) % MOD * combination(K-1,i-1) % MOD << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: expected ';' before '}' token
   24 |         Sepa = N-K+1
      |                     ^
      |                     ;
   25 |     }else{
      |     ~
Language: C++

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

ll combination(ll n, ll r) {
  if ( r * 2 > n ) r = n - r;
  ll dividend = 1;
  ll divisor  = 1;
  for ( unsigned int i = 1; i <= r; ++i ) {
    dividend *= (n-i+1);
    divisor  *= i;
  }
  return dividend / divisor;
}


int main(){
    int N,K;
    cin >> N >> K;
    for(int i=1; i <= N-k+1; i++){
        cout <<  combination(N-K+1,i) % MOD * combination(K-1,i-1) % MOD << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: 'k' was not declared in this scope
   22 |     for(int i=1; i <= N-k+1; i++){
      |                         ^
Language: C++

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

ll combination(ll n, ll r) {
  if ( r * 2 > n ) r = n - r;
  ll dividend = 1;
  ll divisor  = 1;
  for ( unsigned int i = 1; i <= r; ++i ) {
    dividend *= (n-i+1);
    divisor  *= i;
  }
  return dividend / divisor;
}


int main(){
    int N,K;
    cin >> N >> K;
    for(int i=1; i < N-k+1; i++){
        cout <<  combination(N-K+1,i) % MOD * combination(K-1,i-1) % MOD << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: 'k' was not declared in this scope
   22 |     for(int i=1; i < N-k+1; i++){
      |                        ^
Language: C++

 #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <iomanip>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << endl
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
int dx8[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy8[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int dx4[4] = {1, 0, -1, 0};
int dy4[4] = {0, 1, 0, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){ fill((T*)array, (T*)(array+N), val); }
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };


ll inv(ll x){
    ll n=MOD-2,a=1;
    while(n>0){
        if(n%2) a=a*x%MOD;
            x=x*x%MOD;
            n=n/2;
    }
    return a;
}
ll Comb(ll n,ll m){
    ll ans = 1; 
    for(int i=0;i < m; i++){
        ans *= ((n-i)*inv(i+1)) % MOD;
        ans %= MOD;
    }
    return ans;
}

int main()
{
  int N,K;
  cin >> N >> K;
  
  rrep(k,K){
      cout <<Comb(K-1,k-1)*Comb(N-K+1,k)<<endl
  }

}



Compiler output:
a.cc: In function 'int main()':
a.cc:86:47: error: expected ';' before '}' token
   86 |       cout <<Comb(K-1,k-1)*Comb(N-K+1,k)<<endl
      |                                               ^
      |                                               ;
   87 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>

using namespace std;
long long int dizi[10000005]; 
#define MOD 1000000007
long long int a,b;
long long int mavi;
long long int kirmizi;

long long int hizlius(long long int a,long long int b)
{
	if(b==0){
		return 1;
	}
	if(b==1){
		return a;
	}
	long long int kl=hizlius(a,b/2);
	if(b%2==0){
		return (kl*kl)%MOD;
	}
	if(b%2==1){
		return (((kl*kl)%MOD)*a)%MOD;
	}
	
} 

long long int komb(long long int a,long long int b){
	long long int c=b;
	long long int d=a-b;
	long long int reelc=hizlius(dizi[c],MOD-2);
	long long int reeld=hizlius(dizi[d],MOD-2);
	return (((dizi[a]*reelc)%MOD)*reeld)%MOD;
	
}
void coz(int hareket){
	long long	int mav=mavi-hareket;//2
	long long	int kir=kirmizi-(hareket-1);//2
	if(kir <0){
		cout<<0<<" ";
		return;
	}
	long long int toplam=((komb(mav+hareket-1,hareket-1)%MOD)*(komb(kir+hareket,hareket)%mod))%MOD;
	cout<<toplam<<endl;
}

int main(){
	
	cin>>a>>b;
	mavi=b;
	kirmizi=a-b;
	dizi[0]=1;
	for(long long int i =1;i<a+2;i++){
		dizi[i]=(dizi[i-1]*i)%MOD;
	}
	for(int i=1;i<=b;i++){
		coz(i);
	}
}

Compiler output:
a.cc: In function 'void coz(int)':
a.cc:43:94: error: 'mod' was not declared in this scope; did you mean 'modf'?
   43 |         long long int toplam=((komb(mav+hareket-1,hareket-1)%MOD)*(komb(kir+hareket,hareket)%mod))%MOD;
      |                                                                                              ^~~
      |                                                                                              modf
a.cc: In function 'long long int hizlius(long long int, long long int)':
a.cc:26:1: warning: control reaches end of non-void function [-Wreturn-type]
   26 | }
      | ^
Language: C++

#include<bits/stdc++.h>
 using namespace std;
 const int MOD = 1e9 + 7, N = 2005; 
int C[N][N]; int main() 
{  ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); 
 C[0][0] = 1;
  for(int i = 1; i < N; i++)
 {    C[i][0] = 1;   
 for(int j = 1; j < N; j++) 
{      C[i][j] = C[i - 1][j] + C[i - 1][j - 1]; 
     if(C[i][j] >= MOD) C[i][j] -= MOD;    } 
 } 
 int n, k; 
cin >> n >> k; 
 for(int i = 1; i <= k; i++)
 {    cout << (1ll * C[n - k + 1][i] * C[k - 1][i - 1] % MOD) << "\n"; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {  ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int inf=7+1e9,maxn=5+2e3;
typedef unsigned long long ll;
ll qpow(ll a,ll p,ll mod){
	ll ans=1,tmp=a;
	while(p){
		if(p&1)
			ans=ans*tmp%inf;
		tmp=tmp*tmp%inf;
		p>>=1;	
	}
	return ans;
}
ll N(ll k){
	ull ans=1;
	for(ull i=2;i<=k;i++)
		ans=ans*i%inf;
	return ans;	
}
ll C(ll m,ll n){
	return N(n)*qpow(N(m)*N(n-m)%inf,inf-2,inf)%inf;
}
int main(){
	ll n,k;
	cin>>n>>k;
	//BLUE:C(i-1,k-1);RED:C(i,n-k+1);T0TAL:C(i,k-1)*C(i,n-k+1)
	//5 3
	//1:C(0,2)*C(1,3)=3;2:C(1,2)*C(2,3)=2*3=6;C(2,2)*C(3,3)=1
	for(ll i=1;i<=k;i++)
		cout<<C(i-1,k-1)*C(i,n-k+1)%inf<<endl;
}

Compiler output:
a.cc: In function 'll N(ll)':
a.cc:16:9: error: 'ull' was not declared in this scope; did you mean 'll'?
   16 |         ull ans=1;
      |         ^~~
      |         ll
a.cc:17:16: error: expected ';' before 'i'
   17 |         for(ull i=2;i<=k;i++)
      |                ^~
      |                ;
a.cc:17:21: error: 'i' was not declared in this scope
   17 |         for(ull i=2;i<=k;i++)
      |                     ^
a.cc:18:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |                 ans=ans*i%inf;
      |                 ^~~
      |                 abs
a.cc:19:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |         return ans;
      |                ^~~
      |                abs