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

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

const ll INF = 1e17;
const ll MOD = 1e9+7;

https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a#5-%E4%BA%8C%E9%A0%85%E4%BF%82%E6%95%B0-ncr
const int MAX = 1e6+1;
long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


int main() {
    // input
    ll X,Y;
    cin >> X;
    cin >> Y;

    // range check
    bool check =false;
    if (X%3==0 && Y%3==0)check = true;
    if (X%3==2 && Y%3==1)check = true;
    if (X%3==1 && Y%3==2)check = true;
    if (!check) {
        cout << 0 << endl;
        return 0;
    }

    int diff = abs(X-Y);
    int big = max(X,Y);
    int small = min(X,Y);

    int checkb = big - diff*2;
    int checks = small - diff;

    if (checkb != checks || checkb%3 != 0 || checkb < 0) {
        cout << 0 << endl;
        return 0;
    }

    int step2 = checkb /3 + diff;
    int step1 = checkb /3;

    //ll ans = factorial(step2+step1) / factorial(step2) / factorial(step1)

    COMinit();
    cout << COM(step2+step1, step2) << endl;


    return 0;
}


Compiler output:
a.cc:8:1: error: 'https' does not name a type
    8 | https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a#5-%E4%BA%8C%E9%A0%85%E4%BF%82%E6%95%B0-ncr
      | ^~~~~
a.cc:10:15: error: 'MAX' was not declared in this scope
   10 | long long fac[MAX], finv[MAX], inv[MAX];
      |               ^~~
a.cc:10:26: error: 'MAX' was not declared in this scope
   10 | long long fac[MAX], finv[MAX], inv[MAX];
      |                          ^~~
a.cc:10:36: error: 'MAX' was not declared in this scope
   10 | long long fac[MAX], finv[MAX], inv[MAX];
      |                                    ^~~
a.cc: In function 'void COMinit()':
a.cc:14:5: error: 'fac' was not declared in this scope
   14 |     fac[0] = fac[1] = 1;
      |     ^~~
a.cc:15:5: error: 'finv' was not declared in this scope
   15 |     finv[0] = finv[1] = 1;
      |     ^~~~
a.cc:16:5: error: 'inv' was not declared in this scope; did you mean 'int'?
   16 |     inv[1] = 1;
      |     ^~~
      |     int
a.cc:17:25: error: 'MAX' was not declared in this scope
   17 |     for (int i = 2; i < MAX; i++){
      |                         ^~~
a.cc: In function 'long long int COM(int, int)':
a.cc:28:12: error: 'fac' was not declared in this scope
   28 |     return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
      |            ^~~
a.cc:28:22: error: 'finv' was not declared in this scope
   28 |     return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
      |                      ^~~~
Language: C

import math
X,Y = map(int,input().split())
a,b = (2*Y-X)/3,(2*X-Y)/3
n = 10**9+7
def cmb(n, r, mod=10**9+7):
    n1, r = n+1, min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod
def count():
  if not (a//1 == a and b//1==b):
    return 0
  else:
    ahat = int(a%n)
    bhat = int(b%n)
    return cmb(ahat+bhat,ahat)


print(int(count())%(10**9+7))

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import math
      | ^~~~~~
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'X'
    2 | X,Y = map(int,input().split())
      | ^
Language: Java

import java.util.*;

public class Test2 {
	static int N = 1000001;

	// array to store inverse of 1 to N
	static long[] factorialNumInverse = new long[N + 1];

	// array to precompute inverse of 1! to N!
	static long[] naturalNumInverse = new long[N + 1];

	// array to store factorial of first N numbers
	static long fact[] = new long[N + 1];

	// Function to precompute inverse of numbers
	static void InverseofNumber(long p) {
		naturalNumInverse[0] = naturalNumInverse[1] = 1;
		for (int i = 2; i <= N; i++)
			naturalNumInverse[i] = naturalNumInverse[(int) (p % i)] * (p - p / i) % p;
	}

	// Function to precompute inverse of factorials
	static void InverseofFactorial(long p) {
		factorialNumInverse[0] = factorialNumInverse[1] = 1;

		// precompute inverse of natural numbers
		for (int i = 2; i <= N; i++)
			factorialNumInverse[i] = (naturalNumInverse[i] * factorialNumInverse[i - 1]) % p;
	}

	// Function to calculate factorial of 1 to N
	static void factorial(long p) {
		fact[0] = 1;

		// precompute factorials
		for (int i = 1; i <= N; i++) {
			fact[i] = (fact[i - 1] * i) % p;
		}
	}

	// Function to return nCr % p in O(1) time
	static long Binomial(int N, int R, long p) {
		// n C r = n!*inverse(r!)*inverse((n-r)!)
		long ans = ((fact[N] * factorialNumInverse[R]) % p * factorialNumInverse[N - R]) % p;
		return ans;
	}

	// Driver Code
	
	

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		int m = (2*x-y)/3;
		int n = (2*y-x)/3;
		if((2*x-y)%3 ==0 && (2*x-y)%3==0) {
		long p = 1000000007;
		InverseofNumber(p);
		InverseofFactorial(p);
		factorial(p);
		long sum =0;
		for(int i=1;i<=Math.min(m, n);i++) {
			sum += (Binomial(m+1, i, p) * Binomial(n-1, i-1, p))%p;
			sum%=p;
			
		}
		System.out.println(sum);
		}else {
			System.out.println(0);
		}
		
	}

	public static int c(int n, int r) {
		return 1;
	}

}


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

#include<bits/stdc++.h> 
 
using namespace std;
typedef long long ll;
 
int gcdExtended(int a, int b, int *x, int *y); 
  
// Function to find modulo inverse of b. It returns 
// -1 when inverse doesn't 
int Inverse(int b, int m) 
{ 
    int x, y; // used in extended GCD algorithm 
    int g = gcdExtended(b, m, &x, &y); 
  
    // Return -1 if b and m are not co-prime 
    if (g != 1) 
        return -1; 
  
    // m is added to handle negative x 
    return (x%m + m) % m; 
}
 
ll modDivide(int a, int b, int m) 
{ 
    a = a % m; 
    int inv = Inverse(b, m); 
     
   	return (inv * a) % m; 
} 
 
int gcdExtended(int a, int b, int *x, int *y) 
{ 
    // Base Case 
    if (a == 0) 
    { 
        *x = 0, *y = 1; 
        return b; 
    } 
  
    int x1, y1; // To store results of recursive call 
    int gcd = gcdExtended(b%a, a, &x1, &y1); 
  
    // Update x and y using results of recursive 
    // call 
    *x = y1 - (b/a) * x1; 
    *y = x1; 
  
    return gcd; 
} 
 
ll power(int x, unsigned int y, int p) 
{ 
    ll res = 1; // Initialize result 
    x = x % p; // Update x if it is more than or 
    // equal to p 
    while (y > 0) { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res * x) % p; 
  
        // y must be even now 
        y = y >> 1; // y = y/2 
        x = (x * x) % p; 
    } 
    return res; 
} 
  
// Function to find modular inverse of a under modulo p 
// using Fermat's method. Assumption: p is prime 
ll modInverse(int a, int p) 
{ 
    return power(a, p - 2, p); 
} 
  
// Returns n! % p using Wilson's Theorem 
ll modfact(int n, int p) 
{ 
    // n! % p is 0 if n >= p 
    if (p <= n) 
        return 0; 
  
    // Initialize result as (p-1)! which is -1 or (p-1) 
    ll res = (p - 1); 
  
    // Multiply modulo inverse of all numbers from (n+1) 
    // to p 
    for (int i = n + 1; i < p; i++) 
        res = (res * modInverse(i, p)) % p; 
    return res; 
} 
 
int main(){
	ll p = 10e9+7;
	ll x,y; cin>>x>>y;
 
 
	 ll a = (2*x-y)/3;
	 ll b = (2*y-x)/3;
 
	if((2*x-y)%3!=0||(2*y-x)%3!=0){
		cout<<0;
	}
	else{
		ll m =(modfact(a,p)*modfact(b,p)) %p;
		
		cout<<modDivide(a+b,m,p);
	}

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

#include<bits/stdc++.h> 

using namespace std;
typedef long long ll;

int gcdExtended(int a, int b, int *x, int *y); 
  
// Function to find modulo inverse of b. It returns 
// -1 when inverse doesn't 
int Inverse(int b, int m) 
{ 
    int x, y; // used in extended GCD algorithm 
    int g = gcdExtended(b, m, &x, &y); 
  
    // Return -1 if b and m are not co-prime 
    if (g != 1) 
        return -1; 
  
    // m is added to handle negative x 
    return (x%m + m) % m; 
}

ll modDivide(int a, int b, int m) 
{ 
    a = a % m; 
    int inv = Inverse(b, m); 
     
   	return (inv * a) % m; 
} 

int gcdExtended(int a, int b, int *x, int *y) 
{ 
    // Base Case 
    if (a == 0) 
    { 
        *x = 0, *y = 1; 
        return b; 
    } 
  
    int x1, y1; // To store results of recursive call 
    int gcd = gcdExtended(b%a, a, &x1, &y1); 
  
    // Update x and y using results of recursive 
    // call 
    *x = y1 - (b/a) * x1; 
    *y = x1; 
  
    return gcd; 
} 

ll power(int x, unsigned int y, int p) 
{ 
    ll res = 1; // Initialize result 
    x = x % p; // Update x if it is more than or 
    // equal to p 
    while (y > 0) { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res * x) % p; 
  
        // y must be even now 
        y = y >> 1; // y = y/2 
        x = (x * x) % p; 
    } 
    return res; 
} 
  
// Function to find modular inverse of a under modulo p 
// using Fermat's method. Assumption: p is prime 
ll modInverse(int a, int p) 
{ 
    return power(a, p - 2, p); 
} 
  
// Returns n! % p using Wilson's Theorem 
ll modfact(int n, int p) 
{ 
    // n! % p is 0 if n >= p 
    if (p <= n) 
        return 0; 
  
    // Initialize result as (p-1)! which is -1 or (p-1) 
    ll res = (p - 1); 
  
    // Multiply modulo inverse of all numbers from (n+1) 
    // to p 
    for (int i = n + 1; i < p; i++) 
        res = (res * modInverse(i, p)) % p; 
    return res; 
} 

int main(){
	ll p = 10e9+7;
	ll x,y; cin>>x>>y;


	 ll a = (2*x-y)/3;
	 ll b = (2*y-x)/3;

	if((2*x-y)%3!=0||(2*y-x)%3!=0){
		cout<<0;
	}
	else{
		ll m =(modfact(a,p)*modfact(b,p)) %p
		
		cout<<modDivide(a+b,m,p);
	}



	



	
	
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:106:17: error: expected ',' or ';' before 'cout'
  106 |                 cout<<modDivide(a+b,m,p);
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){

	long long int x, y, ux=0, uy=0, ans=1, div=1000000007;
	vector<long long int> a;

	cin>> x >> y;

	while (1) {
		if (x == y) {
			if (x % 3 == 0) {
				ux += x / 3;
				uy += x / 3;
				break;
			}
			else {
				cout << "0" << endl;
				return 0;
			}
		}
		else {
			if (x > y) {
				x -= 2;
				y -= 1;
				ux++;
			}
			else {
				x -= 1;
				y -= 2;
				uy++;
			}
		}
	}

	a.resize((int)(min(ux, uy));
	for (int i = max(ux, uy)+1;i <= ux+uy;i++) {
		a[i] = i;
	}
	for (int i = 2;i <= min(ux, uy);i++) {
		for (int j = min(ux, uy) - 1;j > -1;j--) {
			if (a[j] % i == 0) {
				a[j] / i;
				break;
			}
		}
	}

	for (long long int i = 0;i <a.size();i++) {
		ans *= a[i];
		ans = ans % div;
	}

	cout<< ans << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:36: error: expected ')' before ';' token
   41 |         a.resize((int)(min(ux, uy));
      |                 ~                  ^
      |                                    )
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args){



		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int x = sc.nextInt();
		int y = sc.nextInt();
		int d = 100000000

		boolean ans = false;
		long a = 1;
		if(y>x) {
			int yy = y;
			y = x;
			x = yy;
		}
		if((double)x/y>2.0) {

		}else {

			if((y-(x-y))%3!=0) {

			}else {
				ans = true;
				int s = (2*y-x)/3;
				int t = x-y;
				int[] divided = new int[s];
				int[] divide  = new int[s];
				for(int i=0;i<s;i++) {
					divided[i]=s+t+1+i;
					divide[i]=i+1;
				}
				
				for(int i =0;i<s;i++) {
					a = (a*divided[i])%1000000007;
				}
				long b = 1;
				for(int i =0;i<s;i++) {
					b = (b*divide[i])%1000000007;
				}
				long c =1;
				for(int i =0;i<100000;i++) {
					c = (c*b)%1000000007;
				}
				for(int i =0;i<10000;i++) {
					a = (a*c)%1000000007;
				}
				
				for(int i =0;i<7;i++) {
					a = (a*b)%1000000007;
				}
			}
		}
		if(ans) {
			System.out.println(a);
		}else {
			System.out.println(0);
		}
	}

}
/*
class City{
	int order;
	int prefecture;
	int year;
	int number;
	City(int order,int prefecture, int year){
		this.order = order;
		this.prefecture = prefecture;
		this.year = year;
	}
}
*/


Compiler output:
Main.java:12: error: ';' expected
		int d = 100000000
		                 ^
1 error
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
typedef long long ll;
#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)
const ll MOD=1000000007;
const int MAX=100000000;

#include <iostream>
using namespace std;

const int MAX = 510000;
const int MOD = 1000000007;

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

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int abs(int a){
	return a<0? -a:a;
}
void swap(int* a, int* b){
	int c = *a;
	*a=*b;
	*b=c;
}

int main(){
	COMinit();
	int x,y;
	cin >>x>>y;
	if (x<y)
		swap(&x,&y);

	if ((x+y)%3!=0){
		cout << 0;
		return 0;
	}

	int cy=((x+y)/3),cx=(x-cy);
	cout <<COM(cy,cx)<<endl;
}

Compiler output:
a.cc:14:11: error: redefinition of 'const int MAX'
   14 | const int MAX = 510000;
      |           ^~~
a.cc:9:11: note: 'const int MAX' previously defined here
    9 | const int MAX=100000000;
      |           ^~~
a.cc:15:11: error: conflicting declaration 'const int MOD'
   15 | const int MOD = 1000000007;
      |           ^~~
a.cc:8:10: note: previous declaration as 'const ll MOD'
    8 | const ll MOD=1000000007;
      |          ^~~
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int MAX = 200000000;
const int MOD = 1000000007;

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

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll 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(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}







/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll x,y;
  cin>>x>>y;
  if((x+y)%3!=0 || 2*x<y || 2*y<x){
    cout<<0<<endl;
    return 0;
  }
  ll big,small;
  if(x>=y){
    big=x;
    small=y;
  }else{
    big=y;
    small=x;
  }
  ll n=0,k=0;
  ll bigg=big,smalll=small;
  rep(i,bigg){
    big-=1;
    small-=2;
    k+=1;
    if(big==2*small){
      n=small;
      break;
    }
  }
  n+=k;

 cout<<COM(n,k)<<endl;
}


Compiler output:
/tmp/ccgk0xFs.o: in function `COMinit()':
a.cc:(.text+0x39): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccgk0xFs.o
a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccgk0xFs.o
a.cc:(.text+0x130): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccgk0xFs.o
a.cc:(.text+0x162): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccgk0xFs.o
collect2: error: ld returned 1 exit status
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int MAX = 100000000;
const int MOD = 1000000007;

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

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll 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(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}







/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll x,y;
  cin>>x>>y;
  if((x+y)%3!=0 || 2*x<y || 2*y<x){
    cout<<0<<endl;
    return 0;
  }
  ll big,small;
  if(x>=y){
    big=x;
    small=y;
  }else{
    big=y;
    small=x;
  }
  ll n=0,k=0;
  ll bigg=big,smalll=small;
  rep(i,bigg){
    big-=1;
    small-=2;
    k+=1;
    if(big==2*small){
      n=small;
      break;
    }
  }
  n+=k;

 cout<<COM(n,k)M<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:67:16: error: expected ';' before 'M'
   67 |  cout<<COM(n,k)M<<endl;
      |                ^
      |                ;
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int MAX = 300000000;
const int MOD = 1000000007;

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

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll 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(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}







/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll x,y;
  cin>>x>>y;
  if((x+y)%3!=0 || 2*x<y || 2*y<x){
    cout<<0<<endl;
    return 0;
  }
  ll big,small;
  if(x>=y){
    big=x;
    small=y;
  }else{
    big=y;
    small=x;
  }
  ll n=0,k=0;
  ll bigg=big,smalll=small;
  rep(i,bigg){
    big-=1;
    small-=2;
    k+=1;
    if(big==2*small){
      n=small;
      break;
    }
  }
  n+=k;

 cout<<COM(n,k)M<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:67:16: error: expected ';' before 'M'
   67 |  cout<<COM(n,k)M<<endl;
      |                ^
      |                ;
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int MAX = 500000000;
const int MOD = 1000000007;

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

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll 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(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}







/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll x,y;
  cin>>x>>y;
  if((x+y)%3!=0 || 2*x<y || 2*y<x){
    cout<<0<<endl;
    return 0;
  }
  ll big,small;
  if(x>=y){
    big=x;
    small=y;
  }else{
    big=y;
    small=x;
  }
  ll n=0,k=0;
  ll bigg=big,smalll=small;
  rep(i,bigg){
    big-=1;
    small-=2;
    k+=1;
    if(big==2*small){
      n=small;
      break;
    }
  }
  n+=k;

  ll ans=1;
  for(ll i=1;i<=k;i++){
    ans*=n-(i-1);
    ans/=i;
    ans%=MOD;
  }
  cout<<ans%MOD<<endl;
}


Compiler output:
/tmp/ccHU4WqO.o: in function `COMinit()':
a.cc:(.text+0x20): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccHU4WqO.o
a.cc:(.text+0x2b): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccHU4WqO.o
a.cc:(.text+0x32): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccHU4WqO.o
a.cc:(.text+0x39): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccHU4WqO.o
a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccHU4WqO.o
a.cc:(.text+0x130): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccHU4WqO.o
a.cc:(.text+0x14b): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccHU4WqO.o
a.cc:(.text+0x162): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccHU4WqO.o
a.cc:(.text+0x1af): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccHU4WqO.o
/tmp/ccHU4WqO.o: in function `COM(long long, long long)':
a.cc:(.text+0x22c): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccHU4WqO.o
a.cc:(.text+0x247): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int MAX = 900000000;
const int MOD = 1000000007;

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

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll 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(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}







/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll x,y;
  cin>>x>>y;
  if((x+y)%3!=0 || 2*x<y || 2*y<x){
    cout<<0<<endl;
    return 0;
  }
  ll big,small;
  if(x>=y){
    big=x;
    small=y;
  }else{
    big=y;
    small=x;
  }
  ll n=0,k=0;
  ll bigg=big,smalll=small;
  rep(i,bigg){
    big-=1;
    small-=2;
    k+=1;
    if(big==2*small){
      n=small;
      break;
    }
  }
  n+=k;

  ll ans=1;
  for(ll i=1;i<=k;i++){
    ans*=n-(i-1);
    ans/=i;
    ans%=MOD;
  }
  cout<<ans%MOD<<endl;
}


Compiler output:
/tmp/ccevu2o5.o: in function `COMinit()':
a.cc:(.text+0x20): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccevu2o5.o
a.cc:(.text+0x2b): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccevu2o5.o
a.cc:(.text+0x32): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccevu2o5.o
a.cc:(.text+0x39): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccevu2o5.o
a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccevu2o5.o
a.cc:(.text+0x130): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccevu2o5.o
a.cc:(.text+0x14b): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccevu2o5.o
a.cc:(.text+0x162): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccevu2o5.o
a.cc:(.text+0x1af): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccevu2o5.o
/tmp/ccevu2o5.o: in function `COM(long long, long long)':
a.cc:(.text+0x22c): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccevu2o5.o
a.cc:(.text+0x247): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int MAX = 1000000000;
const int MOD = 1000000007;

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

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll 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(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}







/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll x,y;
  cin>>x>>y;
  if((x+y)%3!=0 || 2*x<y || 2*y<x){
    cout<<0<<endl;
    return 0;
  }
  ll big,small;
  if(x>=y){
    big=x;
    small=y;
  }else{
    big=y;
    small=x;
  }
  ll n=0,k=0;
  ll bigg=big,smalll=small;
  rep(i,bigg){
    big-=1;
    small-=2;
    k+=1;
    if(big==2*small){
      n=small;
      break;
    }
  }
  n+=k;

  ll ans=1;
  for(ll i=1;i<=k;i++){
    ans*=n-(i-1);
    ans/=i;
    ans%=MOD;
  }
  cout<<ans%MOD<<endl;
}


Compiler output:
/tmp/ccTVI5x2.o: in function `COMinit()':
a.cc:(.text+0x20): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccTVI5x2.o
a.cc:(.text+0x2b): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccTVI5x2.o
a.cc:(.text+0x32): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccTVI5x2.o
a.cc:(.text+0x39): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccTVI5x2.o
a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccTVI5x2.o
a.cc:(.text+0x130): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccTVI5x2.o
a.cc:(.text+0x14b): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccTVI5x2.o
a.cc:(.text+0x162): relocation truncated to fit: R_X86_64_PC32 against symbol `inv' defined in .bss section in /tmp/ccTVI5x2.o
a.cc:(.text+0x1af): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccTVI5x2.o
/tmp/ccTVI5x2.o: in function `COM(long long, long long)':
a.cc:(.text+0x22c): relocation truncated to fit: R_X86_64_PC32 against symbol `finv' defined in .bss section in /tmp/ccTVI5x2.o
a.cc:(.text+0x247): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<vector>
#include <cmath>

using namespace std;
int main()
{   
    // 整数の入力
    int a,b,tmp,result;
    tmp = 0;
    cin >> a;
    cin >> b;

  	if(a==b){
        if(a % 3 == 0){
            tmp=a*2/3;
        }
    }
    else if((a*2)>=b){
        tmp = (a*2)-b;
        if(tmp % 3 == 0){
            tmp = a - tmp/3;
        }else{
          tmp =0;
    }
    else if((a*2)<b){
        tmp = b - a*2;
        if(tmp % 3 == 0){
            tmp = a - tmp/3;
        }else{
          tmp = 0;
    }

    if(!(tmp == 0)){
        result = 1;
        for(int i=tmp; i>0; i-- ){
            result = result*i;
        }
    }else{
        result = 0;
    }

    cout << result;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: expected '}' before 'else'
   26 |     else if((a*2)<b){
      |     ^~~~
a.cc:19:22: note: to match this '{'
   19 |     else if((a*2)>=b){
      |                      ^
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define f first
#define s second
#define all(container) container.begin(),container.end()
#define fast ios::sync_with_stdio(0); cin.tie(0)
#ifndef ONLINE_JUDGE
#include "debug.cpp"
#endif
#define int long long
const int mod = 1e9+7;  
int power(int a,int b) { if(b==0) return 1; int res = power(a,b/2); if(b&1) return res * res * a; else return res * res; }

map<pair<int,int>,int> mp;
int X,Y;

int cntWays(int x,int y){
  // cout << x << " " << y << '\n';
  if(x>X||y>Y) return 0;
  else if(x==X&&y==Y) return 1;
  else if(mp.find({x,y})!=mp.end()) return mp[{x,y}];
  else{
    mp[{x,y}] = (cntWays(x+2,y+1) + cntWays(x+1,y+2))%mod;
    return mp[{x,y}];
  }
}

int32_t main(){
    
  fast;
  cin >> X >> Y;

  cout << cntWays(0,0);

  return 0;
}

Compiler output:
a.cc:9:10: fatal error: debug.cpp: No such file or directory
    9 | #include "debug.cpp"
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <cmath>
typedef long long ll;
using namespace std;
vector<int> V;

vector<ll> fct(1000010, 1);
vector<ll> invfct(1000010, 1);

ll comb(ll a, ll b){
    if(a==0 && b==0) return 1;
    if(a<b || a < 0) return 0;
    ll tmp = invfct[a-b] * invfct[b] % 1000000007;
    return tmp * fct[a] % 1000000007;
}



ll solve(int i, int j){
    ll count = 0;
    while(true){
        if(2 * j == i) break;
        i -= 1;
        j -= 2;
        count += 1;
    }
　　ll hoge = count + i / 2;
    return comb(hoge, count);
}

ll mod_pow(ll n, ll p) {
    if(p==0) return 1;
    ll res = mod_pow(n*n % 1000000007, p / 2);
    if(p%2==1) res = res * n % 1000000007;
    return res;
}

int main(void){
    // Your code here!
   int X, Y;
   cin >> X >> Y;
   
   if(Y > 2 * X || 2 * Y < X) {
       cout << 0 << endl;
       return 0;
   }
   
   if(Y == 2 * X || 2 * Y == X) {
       cout << 1 << endl;
       return 0;
   }
   
   fct[0] = 1;
   invfct[0] = 1;
   for(ll i = 0; i < 1000010; i++){
       fct[i+1] = (fct[i] * (i+1)) %1000000007;
       invfct[i+1] = (invfct[i] * mod_pow(i+1, 1000000007-2)) % 1000000007;
   }
   
   if( (2 * X - Y) % 3 != 0 ) cout << 0 << endl;
   else cout << solve(X, Y) << endl;
   return 0;
}


Compiler output:
a.cc:32:1: error: extended character 　 is not valid in an identifier
   32 | 　　ll hoge = count + i / 2;
      | ^
a.cc:32:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'll solve(int, int)':
a.cc:32:1: error: '\U00003000\U00003000ll' was not declared in this scope
   32 | 　　ll hoge = count + i / 2;
      | ^~~~~~
a.cc:33:17: error: 'hoge' was not declared in this scope
   33 |     return comb(hoge, count);
      |                 ^~~~
Language: Java

import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
    int x = sc.nextInt(); 
    int y = sc.nextInt(); 
if(x>=y){
 int k = x - y;
  if((y-k)%3!=0) System.out.println(0);
  else{
  int t = (y - k)/3;
    
  System.out.println(calcNumOfCombination(2*t+3*k, t+k));
   
  }
}
   else{
 int k = y - x;
  if((x-k)%3!=0) System.out.println(0);
  else{
  int t = (x - k)/3;
    
  System.out.println(calcNumOfCombination(2*t+3*k, t+k));
   
  }
}

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

Compiler output:
Main.java:32: error: integer number too large
            num = (num * (n - i + 1) / i)%10000000007;
                                          ^
1 error
Language: C++

#include <iostream>
#include <cmath>
using namespace std;

int cvp=1, faktoriyel[666667];




int main(void){
	int x, y;
	cin>>x>>y;
  if((x+y)%3!=0){cout<<0;return 0;}
	int sira=(x+y)/3;
	int bas=2*(x+y)/3;
	cout<<sira<<" "<<bas-x<<endl;
	int a=sira, b=min(bas-x, sira+x-bas);
	faktoriyel[1]=1;
	for(int i=2;i<=sira;i++)faktoriyel[i]=(faktoriyel[i-1]*i)%1000000007;
	cvp=pow((faktoriyel[sira]*faktoriyel[bas-x]*faktoriyel[sira-bas+x])%1000000007,1000000005)%1000000007;
  	cout<<cvp;
  	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:99: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   20 |         cvp=pow((faktoriyel[sira]*faktoriyel[bas-x]*faktoriyel[sira-bas+x])%1000000007,1000000005)%1000000007;
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
      |                |                                                                                   |
      |                __gnu_cxx::__promote<double>::__type {aka double}                                   int
Language: C++

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

const ll INF = 1e17;
const ll MOD = 1e9+7;

ll factorial(int n)
{
    double ret=1;
    for(int i=1; i<=n; i++)
    {
        ret *= (ll)i;
        ret %= MOD;
    }
    return ret;
}

int main() {
    // input
    ll X,Y;
    cin >> X;
    cin >> Y;

    // range check
    bool check =false;
    if (X%3==0 && Y%3==0)check = true;
    if (X%3==2 && Y%3==1)check = true;
    if (X%3==1 && Y%3==2)check = true;
    if (!check) {
        cout << 0 << endl;
        return 0;
    }

    int diff = abs(X-Y);
    int big = max(X,Y);
    int small = min(X,Y);

    int checkb = big - diff*2;
    int checks = small - diff;

    if (checkb != checks || checkb%3 != 0 || checkb < 0) {
        cout << 0 << endl;
        return 0;
    }

    int step2 = checkb /3 + diff;
    int step1 = checkb /3;

    ll ans = factorial(step2+step1) / factorial(step2) / factorial(step1)

    cout << ans%MOD << endl;


    return 0;
}


Compiler output:
a.cc: In function 'll factorial(int)':
a.cc:14:13: error: invalid operands of types 'double' and 'll' {aka 'long long int'} to binary 'operator%'
   14 |         ret %= MOD;
      |         ~~~~^~~~~~
a.cc:14:13: note:   in evaluation of 'operator%=(double, ll {aka long long int})'
a.cc: In function 'int main()':
a.cc:52:5: error: expected ',' or ';' before 'cout'
   52 |     cout << ans%MOD << endl;
      |     ^~~~
Language: C++

#include<stdio.h>

int main(void)
{
  long int X,Y;
  long int a,b;
  scanf("%ld%ld",&X,&Y);
  
  a=(2Y-X)/3;
  b=(2X-Y)/3;
  
  long int S=1; 
  long int i;
  for(i=1;i<=a;i++){
    S=S*(b+i);
  }
  for(i=1;i<=a;i++){
    S=S/i;
  }
  S=S%100000007;
  
  printf("%ld",S);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: unable to find numeric literal operator 'operator""Y'
    9 |   a=(2Y-X)/3;
      |      ^~
a.cc:10:6: error: unable to find numeric literal operator 'operator""X'
   10 |   b=(2X-Y)/3;
      |      ^~
Language: C++

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

int kai(int n){
	int m=1;
	for(int i=1;i<n+1;i++)
		m*=i;
	return m;
};

int main(){
	int x,y;
	cin>>x>>y;
	int long long c=0;
	rep(i, y){
		if(3*i==x){
			c+=kai(i);
		}
	}
	cout<<c%(pow(10,9)+7)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:16: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   24 |         cout<<c%(pow(10,9)+7)<<endl;
      |               ~^~~~~~~~~~~~~~
      |               |           |
      |               |           __gnu_cxx::__promote<double>::__type {aka double}
      |               long long int
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = Integer.parseInt(sc.next());
    int y = Integer.parseInt(sc.next());
    int ans = 0;
    int tmpx = x;
    int tmpy = y;
    if((x % 3 == 0 && y % 3 == 0) || (x % 3 == 1 && y % 3 == 2) || (x % 3 == 2 && y % 3 == 1)) {
      int count = 0;
      while(!(tmpx == 0 && tmpy == 0)) {
        if(tmpx >= tmpy) {
          count++;
          tmpx -= 2;
          tmpy -= 1;
        } else {
          tmpx -= 1;
          tmpy -= 2;
        }
      }
      ans = combinationAndMod((x + y) / 3, count);
    }
    System.out.println(ans);
  }

 static int combinationAndMod(int n, int r) {
   int mod = 1000000007;
        r = Math.min(r, n - r);
        long x = 1, y = 1;
        for (long i = 1; i <= r; i++) {
            x = x * (n - r + i) % mod;
            y = y * i % mod;
        }
        return x * powAndMod(y, mod - 2) % mod;
    }

    static int powAndMod(long a, long b) {
      long mod = 1000000007;
        return (int)b == 0 ? 1 : b % 2 == 1 ? a * powAndMod(a, b - 1) % mod : powAndMod(a * a % mod, b / 2);
    }
}


Compiler output:
Main.java:36: error: incompatible types: possible lossy conversion from long to int
        return x * powAndMod(y, mod - 2) % mod;
                                         ^
Main.java:41: error: incompatible types: possible lossy conversion from long to int
        return (int)b == 0 ? 1 : b % 2 == 1 ? a * powAndMod(a, b - 1) % mod : powAndMod(a * a % mod, b / 2);
                           ^
2 errors
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1000000000
#define ll long long
using namespace std;
int main()
{
    int X, Y;
    cin >> X >> y;
    int dp[X][Y] = {0};
    int mod = 1000000007;
    rep(i, X) rep(j, Y)
    {
        if (i > 0 && j > 1)
            dp[i][j] += dp[i - 1][j - 2];
        if (i > 1 && j > 0)
            dp[i][j] += dp[i - 1][j - 2];
        dp[i][j] = dp[i][j] % mod;
    }
    cout << dp[X - 1][Y - 1] << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'y' was not declared in this scope
   11 |     cin >> X >> y;
      |                 ^
Language: C++

#include <iostream>
#include <cmath>

#define DIV (1000000007)
using namespace std;

int main(void) {
	int X, Y;
	cin >> X >> Y;

	int max = std::max(X, Y);
	int min = std::min(X, Y);

	int ss, bs;
	bool f = false;
	for (int i = 0; i < max; i++) {
		bs = i;
		ss = min - bs*2;
		if (max == ss*2+bs) {
			f = true;
			break;
		}
	}

	if (!f) {
		cout << 0 << endl;
		return;
	}

	long long ans = 1;
	for (int i = 1; i <= bs; i++) {
		for (int j = 1; j <= ss; j++) {
			ans = (ans * bs * ss) % DIV;
		}
	}

	cout << ans << endl;
	return 0;
}


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

#include <iostream>
#include <cmath>
using namespace std;

int cvp=1, faktoriyel[666667];




int main(void){
	int x, y;
	cin>>x>>y;
  if((x+y)%3!=0){cout<<0;return 0;}
	int sira=(x+y)/3;
	int bas=2*(x+y)/3;
	cout<<sira<<" "<<bas-x<<endl;
	int a=sira, b=min(bas-x, sira+x-bas);
	faktoriyel[1]=1;
	for(int i=2;i<=sira;i++)faktoriyel[i]=(faktoriyel[i-1]*i)%1000000007;
	cvp=pow(faktoriyel[sira]*faktoriyel[bas-x]*faktoriyel[sira-bas+x])%1000000007,1000000005)%1000000007;
  	cout<<cvp;
  	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: no matching function for call to 'pow(int)'
   20 |         cvp=pow(faktoriyel[sira]*faktoriyel[bas-x]*faktoriyel[sira-bas+x])%1000000007,1000000005)%1000000007;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from a.cc:2:
/usr/include/c++/14/cmath:1074:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)'
 1074 |     pow(_Tp __x, _Up __y)
      |     ^~~
/usr/include/c++/14/cmath:1074:5: note:   candidate expects 2 arguments, 1 provided
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/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: candidate: 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:380:3: note: candidate: 'constexpr long double std::pow(long double, long double)'
  380 |   pow(long double __x, long double __y)
      |   ^~~
/usr/include/c++/14/cmath:380:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:376:3: note: candidate: 'constexpr float std::pow(float, float)'
  376 |   pow(float __x, float __y)
      |   ^~~
/usr/include/c++/14/cmath:376:3: note:   candidate expects 2 arguments, 1 provided
Language: C++

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



int main() {
 int X, Y;
  cin >> X >> Y;
  
  double x = X;
  double y = Y;
  
  int ans = 0;
  int nUp = 0;
  int nRight = 0;
  
  
  
  
  if ( y < x/2 || y > 2*x || (x+y)%3 != 0){
    cout << ans << endl;
  }else{
    int Z = (X+Y)/3;
    
    nUp = 2 * Z - X;
    nRight = 2 * Z - Y;
    
    ans = nRight;
    cout << ans << endl;
  }
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:35: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   20 |   if ( y < x/2 || y > 2*x || (x+y)%3 != 0){
      |                              ~~~~~^~
      |                                |   |
      |                                |   int
      |                                double
Language: C++

using namespace std;
typedef long long ll;

const ll M = 998244353;

vector<ll> fac(1000001); //n!(mod M)
vector<ll> ifac(1000001); //k!^{M-2} (mod M)
//a,bの範囲的にこれだけ配列を用意していけば十分

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

ll comb(ll a, ll b){ //aCbをmod計算
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = ifac[a-b]* ifac[b] % M;
    return tmp * fac[a] % M;
}

int main()
{
    ll n,k;
    cin >> n >> k;
	if((2*n-k)%3!=0||(2*k-n)%3!=0){
      cout << 0;
      return 0;
    }
    //大した量ではないので，先にfax[i]とifax[i]を全て計算しておく
    fac[0] = 1;
    ifac[0] = 1;
    for(ll i = 0; i<1000001; i++){
        fac[i+1] = fac[i]*(i+1) % M; // n!(mod M)
        ifac[i+1] = ifac[i]*mpow(i+1, M-2) % M; // k!^{M-2} (mod M) ←累乗にmpowを採用
    }


    ll ans=0;
    ans = comb((n+k)/3, (2*n-k)/3)%M;
    cout << ans ;
    return 0;
}

Compiler output:
a.cc:6:1: error: 'vector' does not name a type
    6 | vector<ll> fac(1000001); //n!(mod M)
      | ^~~~~~
a.cc:7:1: error: 'vector' does not name a type
    7 | vector<ll> ifac(1000001); //k!^{M-2} (mod M)
      | ^~~~~~
a.cc: In function 'll comb(ll, ll)':
a.cc:23:14: error: 'ifac' was not declared in this scope
   23 |     ll tmp = ifac[a-b]* ifac[b] % M;
      |              ^~~~
a.cc:24:18: error: 'fac' was not declared in this scope
   24 |     return tmp * fac[a] % M;
      |                  ^~~
a.cc: In function 'int main()':
a.cc:30:5: error: 'cin' was not declared in this scope
   30 |     cin >> n >> k;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:32:7: error: 'cout' was not declared in this scope
   32 |       cout << 0;
      |       ^~~~
a.cc:32:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:36:5: error: 'fac' was not declared in this scope
   36 |     fac[0] = 1;
      |     ^~~
a.cc:37:5: error: 'ifac' was not declared in this scope
   37 |     ifac[0] = 1;
      |     ^~~~
a.cc:46:5: error: 'cout' was not declared in this scope
   46 |     cout << ans ;
      |     ^~~~
a.cc:46:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
#define P 1000000007
typedef long long ll;
int x,y,i,j,m,n;
ll f[1010][1010],fac[1000010];
bool flag;
inline facborn()
{
  fac[0]=fac[1]=1;
  for(int i=2;i<=1000000;i++)
    fac[i]=fac[i-1]*i%P;
}
inline ll fastpow(ll a,ll n,ll p)
{
  ll ans=1;
  while(n)
  {
    if(n&1)ans=ans*a%P;
	a=a*a%P;
	n>>=1;
  }
  return ans;
}
//inline ll fac(int x){ll res=1;for(int i=2;i<=x;i++)res=res*i%P;return res%P;}
inline ny(int b,int p)
{
  return fastpow(b,p-2,p);
}
inline ll C(int n,int m)
{
  if(n==m)return 1;
  else return fac[n]*ny(fac[m],P)%P*ny(fac[n-m],P)%P;
}
int main()
{
  //freopen("t4.in","r",stdin);
  //freopen("t4.out","w",stdout);
  cin>>x>>y;facborn();
  if((x+y)%3!=0){cout<<0<<endl;return 0;}
  n=(x+y)/3;
  if(n<=x&&x<=2*n&&n<=y&&y<=2*n)flag=1;
  if(!flag){cout<<0<<endl;return 0;}
  m=2*n-x+1;
  n++;
  //cout<<n<<" "<<m<<endl;
  //cout<<C(6,3)<<endl;
  //cout<<fac(666666)<<endl;
  //cout<<fac(333333)<<endl;
  cout<<C(n-1,m-1)%P<<endl;
  //cout<<C(6,3)<<endl;
  /*f[0][0]=f[1][2]=f[2][1]=1;
  for(i=1;i<=15;i++)
    for(j=1;j<=15;j++)
	  if(i!=1&&j!=1)
        f[i][j]=f[i-1][j-2]+f[i-2][j-1];
  for(i=1;i<=15;i++){
    for(j=1;j<=15;j++)
	  cout<<f[i][j]<<" ";
	cout<<endl;}*/
  //cout<<f[x][y]<<endl;
  return 0;
}

Compiler output:
a.cc:9:8: error: ISO C++ forbids declaration of 'facborn' with no type [-fpermissive]
    9 | inline facborn()
      |        ^~~~~~~
a.cc: In function 'int facborn()':
a.cc:14:1: warning: no return statement in function returning non-void [-Wreturn-type]
   14 | }
      | ^
a.cc: At global scope:
a.cc:27:8: error: ISO C++ forbids declaration of 'ny' with no type [-fpermissive]
   27 | inline ny(int b,int p)
      |        ^~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <chrono>
#include <utility>
#include <math.h>
#include <cstdint>

#define rep(i, n) for(int i = 0; (i) < (n); (i)++)

using namespace std;

typedef long long ll;

ll calc(ll a, ll b, ll p) {
    if (b == 0) {
        return 1;
    } else if (b % 2 == 0) {
        ll d = calc(a, b / 2, p);
        return (d * d) % p;
    } else {
        return (a * calc(a, b - 1, p)) % p;
    }
}

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

void comb(vector<vector <long long int> > &v){
  for(int i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(int k = 1;k <v.size();k++){
    for(int j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
    }
  }
}


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


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


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int x, y;
    cin >> x >> y;

    int ans = 0;

    if((x+y) % 3 == 0) {
        long long int a = (x + y) / 3;
        long long int b = min((2 * x - y) / 3, (2 * y - x) / 3);
        //ans = calc(a, b, pow(10,9) + 7);
        vector<vector<long long int> > v(a+1,vector<long long int>(a+1,0));
        //ans = comb(v) % (long long int)(pow(10,9) + 7);
        //comb(v);
        ans = combi(a, b) % (long long int)(pow(10,9) + 7);
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:91:27: error: no match for 'operator%' (operand types are 'std::vector<std::vector<long long int> >' and 'long long int')
   91 |         ans = combi(a, b) % (long long int)(pow(10,9) + 7);
      |               ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                    |        |
      |                    |        long long int
      |                    std::vector<std::vector<long long int> >