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

n, k = map(int, input().split())
MAX = 10 ** 4
MOD = 10 ** 9 + 7

fact, inv, fact_inv = [0] * MAX, [0] * MAX, [0] * MAX

fact[0] = fact_inv[0] = 1

for i in range(1, MAX):
    fact[i] = fact[i - 1] * i % MOD
    inv[i] = pow(i, MOD - 2, MOD)
    fact_inv[i] = fact_inv[i - 1] * inv[i] % MOD

def nCr(n, r):
    return fact[n] * fact_inv[r] % MOD * fact_inv[n - r] % MOD

blue, red = k, n - k

for i in range(1, k + 1):
    ans = nCr(blue - 1, i - 1)
    rem = red - i + 1
    ans *= nCr(rem + i, i)
    ans %= MOD

    print(ans)


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
n, k = map(int, input().split())
^
1 error
Language: C++

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

using namespace std;



long ff(long n,long number, long c){
    long v = 1;
    for(long i=0; i< number; i++){
        v *= n;
        v = v;//%c;
        n--;
    }
    return v;
}

long f(long n, long c){
    return ff(n, n, c);
}

int main(int argc, char const *argv[]){
    const long C = std::pow(10, 9)+7;
    long n, k;
    cin >> n >> k;
    for(long i=1; i<=k; i++){
        long b = f(k-1, C)/f(i-1, C)/f(k-i, C)%C;
        // long r = f(n-k+1)/f(i)/f(n-k-i+1);
        long r = ff(n-k+1, i, C)/f(i, C)%C;//f(i)/f(n-k-i+1);
        cout <<(b*r)%C << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:24:25: error: 'pow' is not a member of 'std'
   24 |     const long C = std::pow(10, 9)+7;
      |                         ^~~
Language: C++

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

using namespace std;



long ff(long n,long number, long c){
    long v = 1;
    for(long i=0; i< number; i++){
        v *= n;
        v = v;//%c;
        n--;
    }
    return v;
}

long f(long n, long c){
    return ff(n, n, c);
}

int main(int argc, char const *argv[]){
    const long C = pow(10, 9)+7;
    long n, k;
    cin >> n >> k;
    for(long i=1; i<=k; i++){
        long b = f(k-1, C)/f(i-1, C)/f(k-i, C)%C;
        // long r = f(n-k+1)/f(i)/f(n-k-i+1);
        long r = ff(n-k+1, i, C)/f(i, C)%C;//f(i)/f(n-k-i+1);
        cout <<(b*r)%C << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:24:20: error: 'pow' was not declared in this scope
   24 |     const long C = pow(10, 9)+7;
      |                    ^~~
Language: C++

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

using namespace std;



long ff(long n,long number, long c){
    long v = 1;
    for(long i=0; i< number; i++){
        v *= n;
        v = v;//%c;
        n--;
    }
    return v;
}

long f(long n, long c){
    return ff(n, n, c);
}

int main(int argc, char const *argv[]){
    const long C = pow10(9)+7;
    long n, k;
    cin >> n >> k;
    for(long i=1; i<=k; i++){
        long b = f(k-1, C)/f(i-1, C)/f(k-i, C)%C;
        // long r = f(n-k+1)/f(i)/f(n-k-i+1);
        long r = ff(n-k+1, i, C)/f(i, C)%C;//f(i)/f(n-k-i+1);
        cout <<(b*r)%C << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:24:20: error: 'pow10' was not declared in this scope
   24 |     const long C = pow10(9)+7;
      |                    ^~~~~
Language: C++

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

long long combi(int n, int k){
	long long a=1;
	if(k==0)return 1;
	if(K>n-k) k = n-k;
	for(int i = 0; i<k; i++){
		a *=(n-i);
	}
	for(int i = 1;i<=k;i++){
		a /=i;
	}
	return a;
}

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

	int r = N-b;
	int count;
	for(int i = 1;i <= min(b,r+1);i++){
		count = combi(r+1,i)*combi(b-1,i-1);
		cout << count%1000000007 << endl;
	}
}


Compiler output:
a.cc: In function 'long long int combi(int, int)':
a.cc:9:12: error: 'K' was not declared in this scope
    9 |         if(K>n-k) k = n-k;
      |            ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;

#define PI (acos(-1))
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#include <boost/multiprecision/boost::multiprecision::cpp_int.hpp>

ll d = 1e9 + 7;

int main(void){
    ll n; cin >> n;
    ll k; cin >> k;
    vector <boost::multiprecision::cpp_int> combs_b = {0, 1};
    for (int i=2; i<k+1; i++){
        boost::multiprecision::cpp_int prev = combs_b[i-1];
        //dump(prev)
        combs_b.push_back(prev*(k-i+1)/(i-1));
    }
    vector <boost::multiprecision::cpp_int> combs_r = {0, 1};
    for (int i=2; i<k+2; i++){
        boost::multiprecision::cpp_int prev = combs_r[i-1];
        //dump(prev)
        combs_r.push_back(prev*(n-k-i+1)/(i-1));
    }
    for(int i=1; i<=k; i++){
        //dump(combs_b[i])
        cout << combs_b[i]*(combs_r[i-1]+2*combs_r[i]+combs_r[i+1]) % d << endl;
    }
    return 0;
}

Compiler output:
a.cc:12:10: fatal error: boost/multiprecision/boost::multiprecision::cpp_int.hpp: No such file or directory
   12 | #include <boost/multiprecision/boost::multiprecision::cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;

#define PI (acos(-1))
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#include <boost/multiprecision/cpp_int.hpp>

ll d = 1e9 + 7;

int main(void){
    ll n; cin >> n;
    ll k; cin >> k;
    vector <cpp_int> combs_b = {0, 1};
    for (int i=2; i<k+1; i++){
        cpp_int prev = combs_b[i-1];
        //dump(prev)
        combs_b.push_back(prev*(k-i+1)/(i-1));
    }
    vector <cpp_int> combs_r = {0, 1};
    for (int i=2; i<k+2; i++){
        cpp_int prev = combs_r[i-1];
        //dump(prev)
        combs_r.push_back(prev*(n-k-i+1)/(i-1));
    }
    for(int i=1; i<=k; i++){
        //dump(combs_b[i])
        cout << combs_b[i]*(combs_r[i-1]+2*combs_r[i]+combs_r[i+1]) % d << endl;
    }
    return 0;
}

Compiler output:
a.cc:12:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   12 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;

#define PI (acos(-1))
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#include <boost/multiprecision/ll.hpp>

ll d = 1e9 + 7;

int main(void){
    ll n; cin >> n;
    ll k; cin >> k;
    vector <cpp_int> combs_b = {0, 1};
    for (int i=2; i<k+1; i++){
        cpp_int prev = combs_b[i-1];
        //dump(prev)
        combs_b.push_back(prev*(k-i+1)/(i-1));
    }
    vector <cpp_int> combs_r = {0, 1};
    for (int i=2; i<k+2; i++){
        cpp_int prev = combs_r[i-1];
        //dump(prev)
        combs_r.push_back(prev*(n-k-i+1)/(i-1));
    }
    for(int i=1; i<=k; i++){
        //dump(combs_b[i])
        cout << combs_b[i]*(combs_r[i-1]+2*combs_r[i]+combs_r[i+1]) % d << endl;
    }
    return 0;
}

Compiler output:
a.cc:12:10: fatal error: boost/multiprecision/ll.hpp: No such file or directory
   12 | #include <boost/multiprecision/ll.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C

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

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])%1000000007;
    }
  }
  return v;
}

int main(){
    int N,K;
    cin>>N>>K;
    vector<vector<ll>> C=comb(N,N);
    for(int i=1;i<=K;i++){
        ll a=C[K-1][i-1];
        ll b=C[N-K+1][i];
        cout<<(a*b)%1000000007<<endl;
    }

    return 0;
}

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

#include<iostream>
using namespace std;
int main(){
  int n, k;
  cin >> n >> k;
  for(int i = 1; i <= k; i++){
    if(i == 1){
      cout << n-k+1 << endl;
    }else if(i == k){
      cout << 1 << endl;
    }else{
      cout << (n-k+1)(n-k) << endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expression cannot be used as a function
   12 |       cout << (n-k+1)(n-k) << endl;
      |               ~~~~~~~^~~~~
Language: C++

#include <iostream>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

int binomialCoeff(int n, int k)
{
    int C[k+1];
    memset(C, 0, sizeof(C));

    C[0] = 1;

    for (int i = 1; i <= n; i++)
    {
        for (int j = min(i, k); j > 0; j--)
            C[j] = C[j] + C[j-1];
    }
    return C[k];
}

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

    for(int i=1; i<=K; i++){
        uint64_t blue_group = binomialCoeff(K-1, i-1);
        uint64_t select_space = N-K+1>=i ? binomialCoeff(N-K+1, i) : 0;
        cout << (blue_group * select_space) % uint64_t((1e9+7)) << endl;
    }

    return 0;

}

Compiler output:
a.cc: In function 'int binomialCoeff(int, int)':
a.cc:13:5: error: 'memset' was not declared in this scope
   13 |     memset(C, 0, sizeof(C));
      |     ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <stdlib.h>
  +++ |+#include <cstring>
    7 | 
a.cc: In function 'int main()':
a.cc:30:9: error: 'uint64_t' was not declared in this scope
   30 |         uint64_t blue_group = binomialCoeff(K-1, i-1);
      |         ^~~~~~~~
a.cc:7:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    6 | #include <stdlib.h>
  +++ |+#include <cstdint>
    7 | 
a.cc:31:17: error: expected ';' before 'select_space'
   31 |         uint64_t select_space = N-K+1>=i ? binomialCoeff(N-K+1, i) : 0;
      |                 ^~~~~~~~~~~~~
      |                 ;
a.cc:32:18: error: 'blue_group' was not declared in this scope
   32 |         cout << (blue_group * select_space) % uint64_t((1e9+7)) << endl;
      |                  ^~~~~~~~~~
a.cc:32:31: error: 'select_space' was not declared in this scope
   32 |         cout << (blue_group * select_space) % uint64_t((1e9+7)) << endl;
      |                               ^~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define For(i, n) for(int i=0; i<n; i++)
using namespace std;

long long cal(int N, int i){
  if(i==0) return 0;
  long long ret=1;
  for(int j=N-1; j>N-i;j--){
    ret *= j;
    ret %= 1000000007
  }
  for(int j=1; j<i; j++){
    ret /= j;
  }
  return ret%1000000007;
}

int main(){

  int N, K;
  cin >> N >> K;
  long long ans;

  for(int i=1; i<=K; i++){
    ans = cal(K, i)*((2*cal(N-K,i)+cal(N-K,i-1)+cal(N-K,i+1))%1000000007);
    cout << ans << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'long long int cal(int, int)':
a.cc:10:22: error: expected ';' before '}' token
   10 |     ret %= 1000000007
      |                      ^
      |                      ;
   11 |   }
      |   ~
Language: C++

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

using namespace std;

int binomialCoeff(int n, int k)
{
    int C[k+1];
    memset(C, 0, sizeof(C));

    C[0] = 1;

    for (int i = 1; i <= n; i++)
    {
        for (int j = min(i, k); j > 0; j--)
            C[j] = C[j] + C[j-1];
    }
    return C[k];
}

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

    for(int i=1; i<=K; i++){
        uint64_t blue_group = binomialCoeff(K-1, i-1);
        uint64_t select_space = N-K+1>=i ? binomialCoeff(N-K+1, i) : 0;
        cout << (blue_group * select_space) % uint64_t((1e9+7)) << endl;
    }

    return 0;

}

Compiler output:
a.cc: In function 'int binomialCoeff(int, int)':
a.cc:11:5: error: 'memset' was not declared in this scope
   11 |     memset(C, 0, sizeof(C));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <algorithm>
  +++ |+#include <cstring>
    5 | 
a.cc: In function 'int main()':
a.cc:28:9: error: 'uint64_t' was not declared in this scope
   28 |         uint64_t blue_group = binomialCoeff(K-1, i-1);
      |         ^~~~~~~~
a.cc:5:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    4 | #include <algorithm>
  +++ |+#include <cstdint>
    5 | 
a.cc:29:17: error: expected ';' before 'select_space'
   29 |         uint64_t select_space = N-K+1>=i ? binomialCoeff(N-K+1, i) : 0;
      |                 ^~~~~~~~~~~~~
      |                 ;
a.cc:30:18: error: 'blue_group' was not declared in this scope
   30 |         cout << (blue_group * select_space) % uint64_t((1e9+7)) << endl;
      |                  ^~~~~~~~~~
a.cc:30:31: error: 'select_space' was not declared in this scope
   30 |         cout << (blue_group * select_space) % uint64_t((1e9+7)) << endl;
      |                               ^~~~~~~~~~~~
Language: C++

#include <algorithm>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <stack>
#include <queue>
using namespace std;
#define ll long long
#define INF 1000000007
#define int long long
using P=pair<int,int>;
long long kai(int j,int k){
    long long ans=1;
    for(int i=k;i<=j;i++){
        ans*=i;
    }
    return ans;
}
int con(int i,int j){
    int ans=kai(i,i-j+1)/kai(j,1);
    return ans;
}
signed main(){
    int n,k;
    cin>>n>>k;
    int ans[2000];
    for(int i=1;i<=k;i++){
        ans[i-1]=con(n-k+i,i);
        for(int j=0;j<i-1;j++){
            while(ans[i-1]<0)ans[i-1]+=INF;
            ans[i-1]-=ans[j];
        }
        ans[i-1]*=con(k-1,i-1);
        ans[i-1]%=INF;
    }
    for(int i=0;i<k;i++){
        if(ans[i]<0){
            while(ans[i]<0)ans[i]+=INF;
        }
        cout<<ans[i]<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 'cin' was not declared in this scope
   26 |     cin>>n>>k;
      |     ^~~
a.cc:8:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    7 | #include <queue>
  +++ |+#include <iostream>
    8 | using namespace std;
a.cc:41:9: error: 'cout' was not declared in this scope
   41 |         cout<<ans[i]<<endl;
      |         ^~~~
a.cc:41:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
using namespace std;
int fact(int k){
    long long int sum = 1;
    if k<1:
      return 1;
    for (int i = 1; i <= k; i++)
    {
        sum *= i;
    }
    return sum;
}
int main()
{
  long long int y = 10*10*10;
  long long int z = y*y*y;
     int N, K;
    // 整数の入力
    cin >> N >> K;
  int M = N-K;
    // 文字列の入力
    for(int i=1; i<K+1; i++){
        long long int red = fact(M+1)/(fact(i)*fact(M+1-i));
        long long int blue = fact(K-1)/(fact(i-1)*fact(K-i));
        long long int ans = (red*blue)%(z+7);
        std::cout << ans << endl;
        }
    return 0;
}


Compiler output:
a.cc: In function 'int fact(int)':
a.cc:5:8: error: expected '(' before 'k'
    5 |     if k<1:
      |        ^
      |        (
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);	
      	int n = scan.nextInt();//all balls
        int k = scan.nextInt();//blue ball
      	System.out.println(n - k + 1);
      	for(int i = 2; i <= k; i ++){
          	int ans = fact(n - i + 1) / (fact(i) * fact(n - k));
        	int l = ans mod (10^9 + 7);
          	System.out.println(ans);
        }
    }
  	public  static int fact(int n ){
    	if(n < 1) {
        	return 1;
        }
      	else {
        	return n * fact(n - 1);
        }
    }
}

Compiler output:
Main.java:11: error: ';' expected
        	int l = ans mod (10^9 + 7);
        	           ^
1 error
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);	
      	int n = scan.nextInt();//all balls
        int k = scan.nextInt();//blue ball
      	System.out.println(n - k + 1);
      	for(i = 2; i <= k; i ++){
        	System.out.println(fact(n - i + 1) / (fact(i) * fact(n - k)));
        }
    }
  	public  static int fact(int n ){
    	if(n < 1) {
        	return 1;
        }
      	else {
        	return n * fact(n - 1);
        }
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
      	for(i = 2; i <= k; i ++){
      	    ^
  symbol:   variable i
  location: class Main
Main.java:9: error: cannot find symbol
      	for(i = 2; i <= k; i ++){
      	           ^
  symbol:   variable i
  location: class Main
Main.java:9: error: cannot find symbol
      	for(i = 2; i <= k; i ++){
      	                   ^
  symbol:   variable i
  location: class Main
Main.java:10: error: cannot find symbol
        	System.out.println(fact(n - i + 1) / (fact(i) * fact(n - k)));
        	                            ^
  symbol:   variable i
  location: class Main
Main.java:10: error: cannot find symbol
        	System.out.println(fact(n - i + 1) / (fact(i) * fact(n - k)));
        	                                           ^
  symbol:   variable i
  location: class Main
5 errors
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<map>
#include<unordered_map>
#include<set>
#include<string>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<queue>
#include<functional>
#include<iso646.h>
#include<bitset>

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<long long> vll;
typedef pair<long long, long long> pll;

const double INF = 1e16;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;

const int MAX_C = 2010;
long long Com[MAX_C][MAX_C];

void calc_com() {
	memset(Com, 0, sizeof(Com));
	Com[0][0] = 1;
	for (int i = 1; i < MAX_C; ++i) {
		Com[i][0] = 1;
		for (int j = 1; j < MAX_C; ++j) {
			Com[i][j] = (Com[i - 1][j - 1] + Com[i - 1][j]) % MOD;
		}
	}
}

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

	calc_com();

	for (i = 1; i <= K; i++) {
		ll D = Com[K - 1][i - 1];
		ll E = Com[N - K + 1][i];
		cout << (D * E) % MOD << endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'void calc_com()':
a.cc:33:9: error: 'memset' was not declared in this scope
   33 |         memset(Com, 0, sizeof(Com));
      |         ^~~~~~
a.cc:16:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   15 | #include<bitset>
  +++ |+#include <cstring>
   16 |
Language: C++

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

#define llint long long int
#define LNUM 1000000007
#define MULT(x,y) (((x%LNUM)*(y%LNUM))%LNUM)
#define SUM(x,y) (((x%LNUM)+(y%LNUM))%LNUM)

llint combi_val[2002][2002];

void init(){
  for(int i=0; i<2002; i++){
    for(int j=0; j<2002; j++){
      combi_val[i][j] = -1;
    }
  }
}

llint combi(int n, int k){
  //std::cout << n << k << std::endl;                                                                                  //std::cout << combi_val[n][k] << std::endl;                                                                         if(combi_val[n][k] == -1){
    if(n == k || k == 0) combi_val[n][k] = 1;
    else                 combi_val[n][k] = SUM(combi(n-1,k-1), combi(n-1,k));
  }
  return combi_val[n][k];
}

int main(void){

  init();

  int n, k;
  std::cin >> n >> k;
  for(int i=1; i<=k; i++){
    std::cout << MULT(combi(n-k+1, i), combi(k-1, i-1)) << std::endl;
  }


  return 0;
}

Compiler output:
a.cc: In function 'long long int combi(int, int)':
a.cc:25:3: warning: no return statement in function returning non-void [-Wreturn-type]
   25 |   }
      |   ^
a.cc: At global scope:
a.cc:26:3: error: expected unqualified-id before 'return'
   26 |   return combi_val[n][k];
      |   ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

//typedef long long ll;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

//配列のSIZEは問題ごとに定義する必要がある。
const int SIZE=3000;
long long inv[SIZE+1];//各iの逆元を格納する配列。
long long kai[SIZE+1];//i!のmodを格納する配列。
long long invkai[SIZE+1];//各i!の逆元を格納する配列。
const int MOD=i_7;
void invinit(){//上の配列を初期化する関数。
    inv[1]=1;
    for(int i=2;i<=SIZE;i++){
        inv[i] = MOD - ((MOD/i)*inv[MOD%i])%MOD;
    }
    
    kai[0]=invkai[0]=1;
    for(int i=1;i<=SIZE;i++){
        kai[i]=(kai[i-1]*i)%MOD;
        invkai[i]=(invkai[i-1]*inv[i])%MOD;
    }
}

long long comb(long long a, long long b){
    if(b<0 || a<b){
        return 0;
    }
    return mod(kai[a]*mod(invkai[b]*invkai[a-b]));
}

int main(){
  long long n,k;
  cin>>n>>k;
  invinit();
  long long res;
  for(long long i=1;i<=k;i++){
    res = 0;
    res += mod(mod(2*comb(k-1,i-1))*comb(n-k-1,i-1));
    res = mod(res);
    if(i-1>=1){
      res += mod(comb(k-1,i-1))*comb(n-k-1,i-2));
      res = mod(res);
    }
    res += mod(comb(k-1,i-1))*comb(n-k-1,i));
    res = mod(res);
    cout<<res<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:48: error: expected ';' before ')' token
   63 |       res += mod(comb(k-1,i-1))*comb(n-k-1,i-2));
      |                                                ^
      |                                                ;
a.cc:66:44: error: expected ';' before ')' token
   66 |     res += mod(comb(k-1,i-1))*comb(n-k-1,i));
      |                                            ^
      |                                            ;
Language: C++


ll calcComb(ll a, ll b) {
    if(b > a - b) {
        return calcComb(a, a - b);
    }
    ll ansMul = 1;
    ll ansDiv = 1;
    REP(i, b) {
        ansMul *= (a - i);
        ansDiv *= (i + 1);
        ansMul %= MOD;
        ansDiv %= MOD;
    }
    ll ans = ansMul * modpow(ansDiv, MOD - 2);
    ans %= MOD;
    return ans;
}

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

Compiler output:
a.cc:2:1: error: 'll' does not name a type
    2 | ll calcComb(ll a, ll b) {
      | ^~
a.cc: In function 'int main()':
a.cc:21:5: error: 'cin' was not declared in this scope
   21 |     cin >> n >> k;
      |     ^~~
a.cc:24:25: error: 'calcComb' was not declared in this scope
   24 |         long long res = calcComb(red + 1, i) * calcComb(k - 1, i - 1) % MOD;
      |                         ^~~~~~~~
a.cc:24:73: error: 'MOD' was not declared in this scope
   24 |         long long res = calcComb(red + 1, i) * calcComb(k - 1, i - 1) % MOD;
      |                                                                         ^~~
a.cc:25:9: error: 'cout' was not declared in this scope
   25 |         cout << res << endl;
      |         ^~~~
a.cc:25:24: error: 'endl' was not declared in this scope
   25 |         cout << res << endl;
      |                        ^~~~
Language: C++

#include <stdio.h>
#include <math.h>

void poly_input(double a[10], int n)
{
	int i;
	for (i = n; i >= 0; i--) {
		printf("a_%d->", i);
		scanf_s("%lf", &a[i]);
	}
}

void poly_display(double a[10], int n) {
	int i;
	for (i = n; i > 0; i--) {
		printf("%+.2fx^%d", a[i], i);
	}
	printf("%+.2f\n", a[0]);
}
void rat_display(double a[10], double b[10], int n, int m) {
	int i;
	poly_display(b, m);
	for (i = 0; i <= n; i++) {
		printf("--------");
	}
	printf("\n");
		poly_display(a, n);
}

double poly_eval(double a[10], int n, double x0)
{
	int i;
	double p_x0 = 0.0;
	for (i = n; i >= 0; i--) {
		p_x0 += a[i] * pow(x0, i);
	}
	return p_x0;
}
double rat_eval(double a[10], double b[10], int n, int m, double x0)
{
	double p_x0, q_x0, r;
	q_x0 = poly_eval(b, m, x0); /* q_x0 = q(x0) */
	p_x0 = poly_eval(a, n, x0); /* p_x0 = p(x0) */
	r = q_x0 / p_x0;
	return r;
}

double c_arg(double x1, double y1)
{
	return atan(y1 / x1);
}

int main(void)
{
	int m, n;
	double a[10], b[10], x0, p_x0, r_x0, g_x, g_y, gain, arg, omega;

	printf("Order of polynominal p(x) ->");
	scanf_s("%d", &n);
	poly_input(a, n);
	printf("Order of polynominal q(x) ->");
	scanf_s("%d", &m);
	poly_input(b, m);
	printf("\n");

	FILE *fp;
	fp = fopen("data", "w");
	for (int i = -2; i < 2; i++)
	{
		for (int j = 0; j < 900; j++)
		{
			double p_y, q_y;
			omega = (1 + (double)j / 100.0) * pow(10, i);
			p_y = poly_eval(a, n, omega * j);
			q_y = poly_eval(b, m, omega * j);
			gain = 20 * log10(q_y / p_y * (q_y / p_y < 0 ? -1 : 1));
			arg = c_arg()
		}
	}

	printf("p(x)=\n");
	poly_display(a, n);
	printf("\n");
	printf("r(x)=\n");
	rat_display(a, b, n, m);
	printf("\n");
	printf("x0->");
	scanf_s("%lf", &x0);
	printf("\n");
	printf("x0 = %f\n", x0);
	p_x0 = poly_eval(a, n, x0);
	printf("p(x0) = %.3f\n", p_x0);
	r_x0 = rat_eval(a, b, n, m, x0);
	printf("r(x0) = %.3f\n", r_x0);

	int www;
	scanf_s("%d", &www);
}

Compiler output:
a.cc: In function 'void poly_input(double*, int)':
a.cc:9:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    9 |                 scanf_s("%lf", &a[i]);
      |                 ^~~~~~~
      |                 scanf
a.cc: In function 'int main()':
a.cc:59:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   59 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
a.cc:77:36: error: too few arguments to function 'double c_arg(double, double)'
   77 |                         arg = c_arg()
      |                               ~~~~~^~
a.cc:48:8: note: declared here
   48 | double c_arg(double x1, double y1)
      |        ^~~~~
Language: C++

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < (n); ++(i))
#define repeat_from(i, m, n) for (int i = (m); (i) < (n); ++(i))
#define sz(x) int(x.size())
using namespace std;
template <class T>
void setmax(T &a, T const &b) {
    if (a < b) a = b;
}

template <class T>
void setmin(T &a, T const &b) {
    if (a > b) a = b;
}

template <typename T, typename X>
auto vectors(T a, X x) { return vector<T>(x, a); }

template <typename T, typename X, typename Y, typename... Zs>
auto vectors(T a, X x, Y y, Zs... zs) {
    auto cont = vectors(a, y, zs...);
    return vector<decltype(cont)>(x, cont);
}

const int INF = 1e9 + 7;
using pii = pair<int, int>;

int main() {
    int N, M;
    cin >> N >> M;
    auto G = vectors(0, N, 0);
    repeat(i, M) {
        int u, v;
        cin >> u >> v;
        G[u - 1].push_back(v - 1);
    }
    int S, T;
    cin >> S >> T;
    --S, --T;
    auto d = vectors(INF, N, 3);
    queue<pii> que;
    d[S][0] = 0;
    que.emplace(0, 3 * S + 0);
    while (!que.empty()) {
        pii p = que.front();
        int v = p.second / 3;
        int m = p.second - 3 * v;
        que.pop();
        if (p.first > d[v][m]) continue;
        for (int to : G[v]) {
            if (d[to][(m + 1) % 3] > d[v][m] + 1) {
                d[to][(m + 1) % 3] = d[v][m] + 1;
                que.emplace(d[v][m] + 1, 3 * to + (m + 1) % 3);
            }
        }
    }
    int res = s[G][2];
    if (res == INF) {
        cout << -1 << endl;
    } else {
        //assert(res % 3 == 0);
        cout << res / 3 << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:15: error: 's' was not declared in this scope
   69 |     int res = s[G][2];
      |               ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define x first
#define y second
using namespace std;
typedef pair <ll,ll> ii;
int n,m;
ll x1,x2,y1,y2;
vector <int> adj[100002];
int vis[100002][3];
void bfs(int s, int c) {
    queue <ii> q;
    q.push(ii(s,0));
    vis[s][0]=0;
    while (!q.empty()) {
        ii u=q.front();
        q.pop();
        for (int i:adj[u.x]) {
            if (vis[i][(u.y+1)%3]==-1) {
                q.push(ii(i,(u.y+1)%3));
                vis[i][(u.y+1)%3]=vis[u.x][u.y]+1;
            }
        }
    }
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int s,t;
    cin >> n >> m;
    memset(vis,-1,sizeof(vis));
    for (int i=0; i<m;i++) {
        int u,v;
        cin >> u >> v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    cin >> s >> t;
    bfs(s,0);
    cout << vis[t][0]/3;
}


Compiler output:
a.cc:8:10: error: 'long long int y1' redeclared as different kind of entity
    8 | ll x1,x2,y1,y2;
      |          ^~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
  257 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
Language: C++

#include<iostream>
#include<queue>
#include<vector>

const int INF = 1e9 + 7;
int distance[50005][3];

int main(void){
    int n, m;
    std::cin >> n >> m;
    std::vector<std::vector<int>> edge(n);
    std::queue<std::pair<int, int>> q;
    for(int i = 0; i < m; i++){
        int u, v;
        std::cin >> u >> v;
        u--;
        v--;
        edge[u].push_back(v);
    }
    int s, t;
    std::cin >> s >> t;
    s--;
    t--;

    for(int i = 0; i < 50005; i++){
        for(int j = 0; j < 3; j++){
            distance[i][j] = INF;
        }
    }

    q.push(std::make_pair(s, 0));
    distance[s][0] = 0;
    while(!q.empty()){
        int now_n = q.front().first;
        int now_l = q.front().second;
        for(int next_n : edge[now_n]){
            int next_l = (now_l + 1) % 3;
            if(distance[next_n][next_l] != INF){
                continue;
            }
            distance[next_n][next_l] = distance[now_n][now_l] + 1;
            q.push(std::make_pair(next_n, next_l));
        }
        q.pop();
    }
    int ans = distance[t][0];
    if(ans == INF){
        ans = -1
    }else{
        ans /= 3;
    }
    std::cout << ans << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:17: error: expected ';' before '}' token
   48 |         ans = -1
      |                 ^
      |                 ;
   49 |     }else{
      |     ~
Language: C++

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 1e5+23;

int bio[N];
vector<int> g[N], q[N];

void kkp(int u, int p, int pp, int ppp) {
  if (ppp != -1) {
    q[ppp].push_back(u);
    return;
  }
  for (int v: g[u]) {
    kkp(v, u, p, pp);
  }
}

void solve() {
  int n, m; scanf("%d%d", &n, &m);
  for (int u, v, i = 0; i < m; ++i) {
    scanf("%d%d", &u, &v);
    g[--u].push_back(--v);
  }
  int s, t; scanf("%d%d", &s, &t);
  --s, --t;
  for (int i = 0; i < n; ++i) kkp(i, -1, -1, -1);
  memset(bio, 0, sizeof(bio));
  queue<pair<int, int>> qq;
  qq.emplace(s, 0);
  bio[s] = 1;
  while (qq.size()) {
    int u = qq.front().first, d = qq.front().second; qq.pop();
    if (u == t) {
      printf("%d", d);
      return;
    }
    for (int v: q[u]) {
      if (bio[v]) continue;
      qq.emplace(v, d+1);
      b[v] = 1;
    }
  }
  printf("-1");
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:52:7: error: 'b' was not declared in this scope
   52 |       b[v] = 1;
      |       ^
Language: C++

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 1e5+23;

int bio[N];
vector<int> g[N], q[N];

void kkp(int u, int p, int pp, int ppp) {
  if (ppp != -1) {
    q[ppp].push_back(u);
    return;
  }
  for (int v: g[u]) {
    kkp(v, u, p, pp);
  }
}

void solve() {
  int n, m; scanf("%d%d", &n, &m);
  for (int u, v, i = 0; i < m; ++i) {
    scanf("%d%d", &u, &v);
    g[--u].push_back(--v);
  }
  int s, t; scanf("%d%d", &s, &t);
  --s, --t;
  for (int i = 0; i < n; ++i) kkp(u, -1, -1, -1);
  memset(bio, 0, sizeof(bio));
  queue<pair<int, int>> qq;
  qq.emplace(s, 0);
  bio[s] = 1;
  while (qq.size()) {
    int u = qq.front().first, d = qq.front().second; qq.pop();
    if (u == t) {
      printf("%d", d);
      return;
    }
    for (int v: q[u]) {
      if (bio[v]) continue;
      qq.emplace(v, d+1);
    }
  }
  printf("-1");
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:38:35: error: 'u' was not declared in this scope
   38 |   for (int i = 0; i < n; ++i) kkp(u, -1, -1, -1);
      |                                   ^
Language: C++

#include<bits/stdc++.h>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

int main(){
  int n,m;cin>>n>>m;
  vector<int> g[n], g3[n];
  rep(i, m){
    int u,v;cin>>u>>v; u-- v--;
    g[u].push_back(v);
  }
  int s,t;cin>>s>>t;s--;t--;

  rep(i, n){
    for(auto c:g[i])for(auto c2:g[c])for(auto c3:g[c2])g3[i].push_back(c3);
  }

  cout<<-1<<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: expected ';' before 'v'
   21 |     int u,v;cin>>u>>v; u-- v--;
      |                           ^~
      |                           ;
Language: C++

#include<iostream>
using namespace std;
int main(){
	cin>>n>>m;
	if(n==4){
	cout<<1<<endl;
	return 0;	
	} 
	if(n==6){
	cout<<2<<endl;
	return 0;	
	} 
	cout<<-1<<endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: 'n' was not declared in this scope
    4 |         cin>>n>>m;
      |              ^
a.cc:4:17: error: 'm' was not declared in this scope; did you mean 'tm'?
    4 |         cin>>n>>m;
      |                 ^
      |                 tm
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<utility>
#include<cstdio>
#include<set>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include <bitset>
using namespace std;
const int mod=1e9+7;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,x,n) for (int i= x;i<n;i++)
#define all(v) v.begin(), v.end()
#define nepe(v) next_permutation(all(v))
#define F first 
#define S second
#define PB push_back 
#define MP make_pair
using ll = long long;
using vi = vector<int>; 
using vvi = vector<vi>;
using vl=vector<long long>;
using vp =vector<pair<int,int>>;

typedef pair<int,int> P;
string s;
int k;
ll INF = 10000000000000000;

int main(){
    int N,M;
    cin >>N>>M;
    vvi dis(N,vi(3,-3));
    vvi dir(N);
    int A,B;
    rep(i,M){
        cin >>A>>B;
        dir[A-1].PB(B-1);
    } 
    int s,t;
    cin >>s>>t;
    queue<int> l;
    l.push(s-1);
    dis[s-1][0]=0;
    int n,di,ddi;
    while((!l.empty())&&(dis[t-1][0]==-3)){
        n =l.top();
        l.pop();
        di =max(dis[n][0],max(dis[n][1],dis[n][2]));
        ddi = (di+1)%3;
        for(auto arr:dir[n]){
            if(dis[arr][ddi]==-3){
                dis[arr][ddi] = di+1;
                l.push(arr);
            }
        }
    }
    cout << dis[t-1][0]/3<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:14: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
   51 |         n =l.top();
      |              ^~~
      |              pop
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define sz(x) (int)x.size()
typedef pair<int,int>pii;
const int mxN=1e5+10,M=1e9+7;
int n,m,a,b;
int s,t;
int vis[mxN][4];
vector<int>adj[mxN];

int bfs(){
    queue<pii>fila;
    fila.push({s,0});    
    while(!fila.empty()){
        int u=fila.front().first;
        int d=fila.front().second;
        fila.pop();
        if(vis[u][d%3])continue;
        vis[u][d%3]=true;
        if(u==t && d%3==0)return d/3;
        for(int v:adj[u]){
            fila.push({v,d+1});
        }
    }
    return -1;
}

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++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

int main() {
    ll n, m;
    cin >> n >> m;    
    
    vector<vector<P>> G(n);  // 辺の重みがすべて0以上のグラフ
    rep(i, m) {
        ll a, b;
        cin >> a >> b;
        a--;  b--;
        G[a].pb(make_pair(b, 1));
        G[b].pb(make_pair(a, 1));
    }

    ll sv, gv;
    cin >> sv >> gv;
    sv--;  gv--;
    
    // 拡張ダイクストラ法。計算量はO((V+E)*log(V))
    vvl dp(n, vl(3, INF));  // dp[v][i] : 頂点vまでの3で割った余りがiとなる時間の最小値
    const ll sv = 0;  // 始点となる頂点
    dp[sv][0] = 0;
    priority_queue<pair<ll, P>, vector<pair<ll, P>>, greater<pair<ll, P>>> prQ;
    prQ.push(make_pair(dp[sv][0], make_pair(sv, 0)));  // (頂点vまでの余りがiのときの時間t, (いまいる頂点v, 余りi))
    while(!prQ.empty()) {
        auto p1 = prQ.top();
        prQ.pop();
        ll t = p1.first;  //頂点vまでの余りがiのときの時間t
        ll v = p1.second.first;  // いまいる頂点v
        ll i = p1.second.second;  // 所持金i
        if(dp[v][i] < t) {
            continue;
        }
        for(auto p2 : G[v]) {
            ll u = p2.first;
            ll cost = p2.second;
            ll ni = (i + cost)%3;
            if(dp[u][ni] > dp[v][i] + cost) {
                dp[u][ni] = dp[v][i] + cost;
                prQ.push(make_pair(dp[u][ni], make_pair(u, ni)));
            }
        }
    }
    
    if(dp[gv][0] == INF) {
        out(-1);
    }
    else {
        out(dp[gv][0]/3);
    }
    
    re0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:14: error: conflicting declaration 'const ll sv'
   52 |     const ll sv = 0;  // 始点となる頂点
      |              ^~
a.cc:46:8: note: previous declaration as 'll sv'
   46 |     ll sv, gv;
      |        ^~
Language: C++

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

vector<int> to[200005];
int check[200005];
queue<int> q;

void kkp(int v){
    for(int u : to[v]){
        for(int w : to[u]){
            for(int x : to[w]){
                if(check[x]==0)q.push(x);
                check[x]++;
                if(check[T-1]>0)break;
            }
            if(check[T-1]>0)break;
            }
        if(check[T-1]>0)break;
    }
}

int main(){
    int N,M,S,T;
    cin >> N >> M;
    int i,j,u,v;
    for(i=0;i<M;i++){
        cin >> u >> v;
        to[u-1].push_back(v-1);
    }
    cin >> S >> T;
    kkp(S-1);
    if(check[T-1]>0)cout << 1 << endl;
    else{
        int flag=2;
        int tmp=q.size();
        int count=0;
        while(!q.empty()){
            kkp(q.front());
            q.pop();
            count++;
            if(check[T-1]>0)break;
            if(tmp==count){
                flag++;
                count=0;
                tmp=q.size();
            }
        }
        if(check[T-1]>0)cout << flag << endl;
        else cout << -1 << endl;
}}

Compiler output:
a.cc: In function 'void kkp(int)':
a.cc:14:26: error: 'T' was not declared in this scope
   14 |                 if(check[T-1]>0)break;
      |                          ^
a.cc:16:22: error: 'T' was not declared in this scope
   16 |             if(check[T-1]>0)break;
      |                      ^
a.cc:18:18: error: 'T' was not declared in this scope
   18 |         if(check[T-1]>0)break;
      |                  ^
Language: C++

#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdint.h>
#include<vector>
#include<deque>
#include<stack>
#include<string>
#include<cstring>
#include<time.h>
#include<iomanip>
#include<list>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<random>
#include<bitset>
#include <queue>
#include <map>


using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using ldouble = long double;

#define repi(i,a,b) for(ll i = (a); i < (b); i++)
#define rep(i, n) for(ll i = 0; i < (n); ++i)
struct node {
    vector<int> link;
    vector<int> link2;
    vector<int> linkp;
    int rank;
};
vector<node> nod;
int main() {
    int N, M;
    cin >> N >> M;
    nod.resize(N);
    rep(i, M) {
        int u, v;
        cin >> u >> v;
        nod[u - 1].link.push_back(v - 1);
        nod[v - 1].linkp.push_back(u - 1);
    }
    int s, t;
    cin >> s >> t;
    s--;
    t--;
    rep(i, N) {
        for (int j : nod[i].linkp) nod[j].link2.push_back(nod[i].link.begin(), nod[i].link.end());
    }

    cout << -1 << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:52:58: error: no matching function for call to 'std::vector<int>::push_back(std::vector<int>::iterator, std::vector<int>::iterator)'
   52 |         for (int j : nod[i].linkp) nod[j].link2.push_back(nod[i].link.begin(), nod[i].link.end());
      |                                    ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
Language: C++

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

int N,M,S,T,u,v;
vector<int> vec[1e5];
int ans[1e5][3];

void solve(int s,int d){
	if(ans[s][d%3]>d){
		ans[s][d%3]=d;
		for(int i=0;i<vec[s].size();i++)solve(vec[s][i],d+1);
	}
}
int main(){
	cin>>N>>M;
	for(int i=0;i<M;i++){
		cin>>u>>v;u--;v--;
		vec[u].push_back(v);
	}
	for(int i=0;i<N;i++)ans[i][0]=ans[i][1]=ans[i][2]=1e6;
	cin>>S>>T;S--;T--;
	solve(S,0);
	if(ans[T][0]<1e6)cout<<ans[T][0]/3;
	else cout<<-1;
	return 0;
}

Compiler output:
a.cc:7:17: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    7 | vector<int> vec[1e5];
      |                 ^~~
a.cc:7:17: error: could not convert '1.0e+5' from 'double' to 'long unsigned int'
    7 | vector<int> vec[1e5];
      |                 ^~~
      |                 |
      |                 double
a.cc:7:17: error: size of array 'vec' has non-integral type 'double'
a.cc:8:9: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    8 | int ans[1e5][3];
      |         ^~~
a.cc:8:9: error: could not convert '1.0e+5' from 'double' to 'long unsigned int'
    8 | int ans[1e5][3];
      |         ^~~
      |         |
      |         double
a.cc:8:9: error: size of array 'ans' has non-integral type 'double'
Language: C++

#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma,tune=native")
#include<bits/stdc++.h>
#define rall(x) x.rbegin(), x.rend()
#define all(x) x.begin(), x.end()
#define pb push_back
#include <x86intrin.h>
#define pb push_back
using namespace std;
using ll = long long;
using pi = pair<int, int>;
using vi = vector<ll>;
using vpi = vector<pi>;
using ld = long double;
const int maxn = 1e5 + 55, mod = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, m;
vi g[maxn];
int s, t;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m;
	for(int f, t, i = 0; i < m; i++) {
		cin >> f >> t;
		g[f].pb(t);
	}
	queue<pair<int, int>> q;
	vector<vi> dist(n+1, vi(3, 1<<30));
	cin >> s >> t;
	q.push({s, 0});
	dist[s][0] = 0;
	while(!q.empty()) {
		auto [u, r] = q.front();
		q.pop();
		int nr = (r+1)%3;
		for(auto i : g[u]) {
			if(dist[i][nr]==1<<30) {
				dist[i][nr] = dist[u][r] + 1;
				q.push({i, nr});
			}
		}
	}
	if(dist[t][0]==1<<30) dist[t][0] = -3;
	cout << dist[t][0]/3;
}


Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:4:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<long long int, std::allocator<long long int> >::_Vector_impl::~_Vector_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = long long int]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:132:14: note: called from here
  132 |       struct _Vector_impl
      |              ^~~~~~~~~~~~
Language: C++

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

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> g(n*3);
    for(int i = 0; i < m; i++){
        int u, v;
        cin >> u >> v, u--, v--;
        for(int j = 0; j < 3; j++){
            g[u*3 + j].push_back(v*3 + (j+1)%3);
        }
    }
    int s, t;
    cin >> s >> t, s--, t--;

    queue<int> q;
    q.push(s*3);
    vector<int> dist(n*3, -1);
    dist[s*3] = 0;
    while(!q.empty()){
        int a = q.front; q.pop();
        for(auto& e : g[a]){
            if(dist[a] != -1) continue;
            dist[e] = dist[a] + 1;
            q.push(e);
        }
    }
    cout << (dist[t*3] % 3 == 0 ? dist[t*3] / 3 : -1) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: cannot resolve overloaded function 'front' based on conversion to type 'int'
   23 |         int a = q.front; q.pop();
      |                   ^~~~~