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

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

#define FOR(i,m,M) for(int i = m;i<M;i++)

using namespace std;

int N;
double add = 0;
vector<double> x(8), y(8);

int fact(int n)
{
	if (n <= 1)
		return 1;
	else return n * fact(n - 1);
}

void sum(int i)
{
	
	FOR(k, 0, N)
	{
		double xdis = x[i] - x[k],ydis = y[i] - y[k];
		add += sqrt(xdis * xdis + ydis * ydis);
	}
}

int main()
{
	cin >> N;
	FOR(i, 0, N)
	{
		cin >> x[i] >> y[i];
	}
	FOR(i, 0, N)
	{
		sum(i); //すべての(i,j)に対しての距離を足す
	}
	cout<<setprecision(20) << add / N;
}



Compiler output:
a.cc: In function 'void sum(int)':
a.cc:27:24: error: 'sqrt' was not declared in this scope
   27 |                 add += sqrt(xdis * xdis + ydis * ydis);
      |                        ^~~~
Language: C++

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

using namespace  std;
int x[8];
int y[8];
double diff(int i, int j);
int main()
{
	int n; cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> x[i] >> y[i];
	}
	vector<int> pathPoints;
	for (int i = 0; i < n; i++)
	{
		pathPoints.push_back(i);
	}

	int counter = 0;
	double length = 0;
	do
	{
		for (int i = 0; i < n - 1; i++)
		{
			length += diff(pathPoints[i], pathPoints[i + 1]);
		}
		counter++;
	} while (next_permutation(pathPoints.begin(), pathPoints.end()));
	cout << length / counter;
}

double dist(int i, int j)
{
	double xDiff = x[j] - x[i];
	double yDiff = y[j] - y[i];
	return sqrt(xDiff * xDiff + yDiff * yDiff);
}

Compiler output:
a.cc: In function 'double dist(int, int)':
a.cc:40:16: error: 'sqrt' was not declared in this scope
   40 |         return sqrt(xDiff * xDiff + yDiff * yDiff);
      |                ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int x[n];
  int y[n];
  double xx[n];
  double yy[n];
  int i,j;
  for(i=0;i<n;i++){
    cin >> x[i] >> y[i];
    xx[i] = (double)x[i];
    yy[i] = (double)y[i];
  }
  int nkai = 1;
  for(i=2;i<=n;i++){
    nkai*=i;
  }
  double ans = 0.0;
  double tmp = 0.0;

  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      tmp += sqrt((xx[i]-xx[j])*(xx[i]-xx[j])+(yy[i]-yy[j])*(yy[i]-yy[j]));
    }
  }
  ans = tmp * n / nkai
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:23: error: expected ';' before 'cout'
   28 |   ans = tmp * n / nkai
      |                       ^
      |                       ;
   29 |   cout << ans;
      |   ~~~~
Language: C++

#include<map>
#include<vector>
#include<iostream>
#include<algorithm>
#include<numeric>
#include <string.h>
#include <unordered_map>
#include <set>

using namespace std;

typedef long long ll;

string s;

int fact(int i) {
    if (i <= 1) {
        return 1;
    }
    return i * fact(i - 1);
}

void solve() {
    int n;
    cin >> n;
    double len = 0;
    vector<int> x(n), y(n);
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i == j) {
                continue;
            }
            len += hypot(x[i] - x[j], y[i] - y[j]);
        }
    }
    cout << fixed;
    cout.precision(10);
    cout << len / n;
}


int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    solve();
    return 0;
}





Compiler output:
a.cc: In function 'void solve()':
a.cc:36:20: error: 'hypot' was not declared in this scope
   36 |             len += hypot(x[i] - x[j], y[i] - y[j]);
      |                    ^~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
using namespace std;
typedef pair<int,int> Paint;
bool pairSecond(const Paint& pf,Paint&ps){
  if(pf.first == ps.first){
    return pf.second < ps.second;
  }else{
    return pf.first < ps.first;
  }
}
int main(){
  int n;cin>>n;
  vector<Paint> a(n);
  cout << fixed << setprecision(10);
  for(int i = 0; n  > i; i++){
    cin>>a[i].first >> a[i].second;
  }
  sort(a.begin(),a.end(),pairSecond);
  int sm = 0;
  double ans = 0.0;
  do{

    for(int i = 1; n > i; i++){
      ans += (double)sqrt((a[i-1].first-a[i].first)*(a[i-1].first-a[i].first)+(a[i-1].second-a[i].second)*(a[i-1].second-a[i].second));
      //cout << ans << endl;
    }

    sm++;
  }while(next_permutation(a.begin(),a.end()));
  cout << ans/sm << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:22: error: 'sqrt' was not declared in this scope
   27 |       ans += (double)sqrt((a[i-1].first-a[i].first)*(a[i-1].first-a[i].first)+(a[i-1].second-a[i].second)*(a[i-1].second-a[i].second));
      |                      ^~~~
Language: Java

import java.util.*;
import java.io.*;
import java.util.function.*;

class Main {
    static Scanner scanner = new Scanner();
    static int mod = 1000000007;
    static int inf = 0x7ffffff;

    static int n;
    static int[] x, y;
    void solve() {
        n = scanner.nextInt();
        x = new int[n];
        y = new int[n];
        int[] a = new int[n];
        int k = 1;
        for (int i = 0; i < n; i++) {
            k *= i + 1;
            a[i] = i;
            x[i] = scanner.nextInt();
            y[i] = scanner.nextInt();
        }
        double sum = 0;
        do {
            for (int i = 1; i < n; i++) {
                sum += Math.sqrt((x[a[i]] - x[a[i - 1]]) * (x[a[i]] - x[a[i - 1]]) + (y[a[i]] - y[a[i - 1]]) * (y[a[i]] - y[a[i - 1]]));
            }
        } while (AtCoderUtils.nextPermutation(a));
        System.out.println(sum / k);
    }

    public static void main(String[]$) throws Exception {
        new Main().solve();
        System.out.flush();
    }
}

class System {
    static PrintWriter out = new PrintWriter(java.lang.System.out);

    static void exit() {
        java.lang.System.exit(0);
    }
}

class Scanner {
    private BufferedReader reader = new BufferedReader(new InputStreamReader(java.lang.System.in), 0x10000);
    private StringTokenizer tokenizer;

    String next() {
        try {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(reader.readLine());
            }
        } catch (IOException ignored) {
        }
        return tokenizer.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    char[][] nextCharArray(int n, int m) {
        char[][] a = new char[n][m];
        for (int i = 0; i < n; i++) {
            a[i] = next().toCharArray();
        }
        return a;
    }

    int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    int[] nextIntArray(int n, IntUnaryOperator op) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = op.applyAsInt(nextInt());
        }
        return a;
    }

    long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextLong();
        }
        return a;
    }

    long[] nextLongArray(int n, LongUnaryOperator op) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = op.applyAsLong(nextLong());
        }
        return a;
    }
}


Compiler output:
Main.java:29: error: cannot find symbol
        } while (AtCoderUtils.nextPermutation(a));
                 ^
  symbol:   variable AtCoderUtils
  location: class Main
1 error
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>

using namespace std;

double poww(double x) {
	return x * x;
}

int main() {
	int n; cin >> n;
	vector<pair<double, double> > xy(n);
	for (auto& a : xy) cin >> a.first >> a.second;
	sort(xy.begin(), xy.end());
	double ans = 0;
	int cnt = 0;
	do {
		double tmp = 0;
		for (int i = 1; i < n; ++i) {
			tmp += sqrt(poww(xy[i - 1].first - xy[i].first) +
				poww(xy[i - 1].second - xy[i].second));
		}
		ans = (ans * cnt + tmp) / (cnt + 1);
		++cnt;
	} while (next_permutation(xy.begin(), xy.end()));
	printf("%.10f\n", ans);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:32: error: 'sqrt' was not declared in this scope
   23 |                         tmp += sqrt(poww(xy[i - 1].first - xy[i].first) +
      |                                ^~~~
Language: C++

// C.

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

using namespace std;

int main(int argc, char* argv[]) {
#ifdef _MSC_VER
	while (true)
#endif
	{
		int n = -1;
		cin >> n;
		if (n <= 0) return 0;
		int seq[] = { 0,1,2,3,4,5,6,7 };
		double sum = 0;
		double cnt = 0;
		vector<double> x(n), y(n);
		for (int i = 0; i < n; ++i) {
			cin >> x[i] >> y[i];
		}
		do {
			cnt += 1.0;
			for (int i = 1; i < n; ++i) {
				double dx = x[seq[i]] - x[seq[i - 1]];
				double dy = y[seq[i]] - y[seq[i - 1]];
				sum += sqrt(dx * dx + dy * dy);
			}
		} while (next_permutation(seq, seq + n));
		double ans = sum / cnt;
		cout << ans << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:30:40: error: 'sqrt' was not declared in this scope
   30 |                                 sum += sqrt(dx * dx + dy * dy);
      |                                        ^~~~
Language: C++

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

int main()
{
    int n;
    cin >> n;
    double f = 1;
    for(int i = 1; i <= n; i++) f *= i;
    double x[10], y[10];
    for(int i = 0; i < n; i++) cin >> x[i] >> y[i];
    int a[10];
    double ans = 0;
    for(int i = 0; i < n; i++) a[i] = i;
    do{
        double now = 0;
        for(int i = 0; i < n - 1; i++){
            now += sqrt((x[a[i]] - x[a[(i + 1) % n]]) * (x[a[i]] - x[a[(i + 1) % n]]) + 
                        (y[a[i]] - y[a[(i + 1) % n]]) * (y[a[i]] - y[a[(i + 1) % n]]));
        }
        ans += now / f;
    }while(next_permutation(a, a + n));
    cout << fixed << setprecision(15) << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:12: error: 'next_permutation' was not declared in this scope
   25 |     }while(next_permutation(a, a + n));
      |            ^~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a[9],b[9];
	double ans=0;
	cin>>n;
	for(int i=0;i<n;i++)cin>>a[i]>>b[i];
	for(int i=0;i<n;i++)
		for(int j=i+1;j<n;j++)
			ans+=sqrt(fabs(a[i]-a[j])*fabs(a[i]-a[j])+fabs(b[i]-b[j])*fabs(b[i]-b[j]));
	cout<<ans*1.0/(n-1)
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:11:28: error: expected ';' before '}' token
   11 |         cout<<ans*1.0/(n-1)
      |                            ^
      |                            ;
   12 | }
      | ~
Language: C++

#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <queue>
#include <bitset>
#define MOD (1000000007l)
#define rep(i, n) for(long i = 0; i < (n); i++)

using namespace std;

void solve() {
  long N;
  cin >> N;
  vector<long> X(N), Y(N);
  rep (i, N) cin >> X[i] >> Y[i];
  double ans = 0;
  rep (i, N) {
    double tmp = 0;
    rep (j, N) {
      if (i == j) continue;
      tmp += pow((X[i]-X[j]) * (X[i]-X[j]) + (Y[i]-Y[j]) * (Y[i]-Y[j]), 0.5); 
    }
    tmp /= N;
    ans += tmp;
  }
  cout << ans << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:27:14: error: 'pow' was not declared in this scope
   27 |       tmp += pow((X[i]-X[j]) * (X[i]-X[j]) + (Y[i]-Y[j]) * (Y[i]-Y[j]), 0.5);
      |              ^~~
Language: C++

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

using namespace std;

double Q(double x){
  return x*x;
}

double dist(double x1,double y1,double x2,double y2){
  return sqrt(Q(x1-x2)+Q(y1-y2));
}

int main() {
  int n;
  cin>>n;
  vector<pair<int,int>> xy(n);
  for(int i=0;i<n;i++)cin>>xy[i].first>>xy[i].second;
  vector<int>p;
  for(int i=0;i<n;i++)p.push_back(i);
  double ans=0;
  int total=0;
  do{
    for(int j=0;j<n-1;j++){
      ans+=dist(xy[p[j]].first,xy[p[j]].second,
		xy[p[j+1]].first,xy[p[j+1]].second);
    }
    total++;
  }while(next_permutation(p.begin(),p.end()));
  cout<<fixed<<setprecision(20)<<ans/total;
  return 0;
}


Compiler output:
a.cc: In function 'double dist(double, double, double, double)':
a.cc:13:10: error: 'sqrt' was not declared in this scope
   13 |   return sqrt(Q(x1-x2)+Q(y1-y2));
      |          ^~~~
Language: C++

long long exp(ll a, ll n, ll mod){
  ll m = n;
  if (a == 1) return 1;
  vector<ll> subvec;
  ll cnt = 0;
  while (m>0){
    if ((m&1) == 1){
      subvec.push_back(cnt);
    }
    m >>= 1;
    cnt ++;
  }
  ll res = 1;
  vector<ll> vec;
  rep(i, cnt){
    a %= mod;
    vec.push_back(a);
    a = a*a%mod;
  }
  for (auto& e : subvec) {
    res = res*vec[e]%mod;
  }
  return res;
}

Compiler output:
a.cc:1:11: warning: built-in function 'exp' declared as non-function [-Wbuiltin-declaration-mismatch]
    1 | long long exp(ll a, ll n, ll mod){
      |           ^~~
a.cc:1:15: error: 'll' was not declared in this scope
    1 | long long exp(ll a, ll n, ll mod){
      |               ^~
a.cc:1:21: error: 'll' was not declared in this scope
    1 | long long exp(ll a, ll n, ll mod){
      |                     ^~
a.cc:1:27: error: 'll' was not declared in this scope
    1 | long long exp(ll a, ll n, ll mod){
      |                           ^~
a.cc:1:33: error: expression list treated as compound expression in initializer [-fpermissive]
    1 | long long exp(ll a, ll n, ll mod){
      |                                 ^
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
vector<ll> f(1000000);
vector<ll> invf(1000000);

//繰り返し二乗
ll mpow(ll n ,ll p, ll m){
    if(p==0) return 1;
    if(p%2==0){
        ll t=mpow(n,p/2,m);
        return t*t%m;
    }
    else return n*mpow(n,p-1,m)%m;   
}
//combination
void init(){
    f[0]=inv[0]=1;
    for(int i=1;i<1000000;i++){
        f[i]=f[i-1]*i%mod;
        invf[i]=mpow(f[i],mod-2,mod);
    } 
}

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

int main(){
    int x,y;cin>>x>>y;
    int a=2*x-y;
    int b=2*y-x;
    if((x+y)%3!=0){cout <<0; return 0;}
    a/=3;b/=3;
    init();
    cout << comb(a+b,a);
}

Compiler output:
a.cc: In function 'void init()':
a.cc:20:10: error: 'inv' was not declared in this scope; did you mean 'invf'?
   20 |     f[0]=inv[0]=1;
      |          ^~~
      |          invf
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
ll mod=1e9+7;

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

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

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

int main(){
    int x,y;cin>>x>>y;
    int a=2*x-y;
    int b=2*y-x;
    if((a<0||b<0)||(a%3!=0||b%3!=0)) return 0;
    a/=3;b/=3;
    inti();
    cout << comb(a+b,a);
}

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

#include <algorithm>
#include <cmath>
#include <vector>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <ctype.h>
#include <climits>
#include <queue>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i = 0; i < (ll)(n); ++i)
template<class T> inline bool chmax(T& a, T b) { if(a < b){ a=b; return 1; } return 0;}
template<class T> inline bool chmin(T& a, T b) { if(a > b){ a=b; return 1; } return 0;}

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

ll mod_inv(ll a, ll m){
	ll x,y;
	ext_gcd(a,m,x,y);
	return (m + x%m)%m;
}

int main(){
	int x,y;
	cin >> x >> y;
	const ll mod = 1000000007;
	
	if((x+y)%3!=0){
		cout << 0 << endl;
		return 0;
	}
	
	int x1=-1,x2=-1;
	for(int i=0; i<=x; i++){
		for(int j=0; j<=x; j++){
			if(i*1+j*2==x && i*2+j*1==y){
				x1 = i;
				x2 = j;
				break;
			}
		}
	}
	
	if(x1==-1){
		cout << 0 << endl;
		return 0;	
	}
	
	ll ans=1;
	for(int i=1; i<=count; i++){
		ans = (ans*i)%mod;
		if(i<=x1){
			ans = (ans*mod_inv(i,mod))%mod;
		}else{
			int factor = i-x1;
			ans = (ans*mod_inv(factor,mod))%mod;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:23: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<='
   64 |         for(int i=1; i<=count; i++){
      |                      ~^~~~~~~
Language: C++

const ll MOD = 1000000007;
 
int main(){
        int x,y,i,j;
        cin >> x >> y;
        vector<vector<ll>> c(x+y+1);
        c.at(0).push_back(1);
        for(i=1;i<=(x+y)/3;++i){
                for(j=0;j<=i;++j){
                        if(j==0||j==i) c.at(i).push_back(1);
                        else c.at(i).push_back((c.at(i-1).at(j-1)+c.at(i-1).at(j))%MOD);
                }
        }
        if((x+y)%3!=0) cout << 0 << endl;
        else cout << c.at((x+y)/3).at((2*x-y)/3) << endl;
        return 0;

Compiler output:
a.cc:1:7: error: 'll' does not name a type
    1 | const ll MOD = 1000000007;
      |       ^~
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> x >> y;
      |         ^~~
a.cc:6:9: error: 'vector' was not declared in this scope
    6 |         vector<vector<ll>> c(x+y+1);
      |         ^~~~~~
a.cc:6:23: error: 'll' was not declared in this scope
    6 |         vector<vector<ll>> c(x+y+1);
      |                       ^~
a.cc:6:28: error: 'c' was not declared in this scope
    6 |         vector<vector<ll>> c(x+y+1);
      |                            ^
a.cc:11:84: error: 'MOD' was not declared in this scope
   11 |                         else c.at(i).push_back((c.at(i-1).at(j-1)+c.at(i-1).at(j))%MOD);
      |                                                                                    ^~~
a.cc:14:24: error: 'cout' was not declared in this scope
   14 |         if((x+y)%3!=0) cout << 0 << endl;
      |                        ^~~~
a.cc:14:37: error: 'endl' was not declared in this scope
   14 |         if((x+y)%3!=0) cout << 0 << endl;
      |                                     ^~~~
a.cc:15:14: error: 'cout' was not declared in this scope
   15 |         else cout << c.at((x+y)/3).at((2*x-y)/3) << endl;
      |              ^~~~
a.cc:15:53: error: 'endl' was not declared in this scope
   15 |         else cout << c.at((x+y)/3).at((2*x-y)/3) << endl;
      |                                                     ^~~~
a.cc:16:18: error: expected '}' at end of input
   16 |         return 0;
      |                  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

using ll = long long;
const ll MOD = 1000000007;
 
int main(){
        int x,y,i,j;
        cin >> x >> y;
        vector<vector<ll>> c(x+y+1);
        c.at(0).push_back(1);
        for(i=1;i<=(x+y)/3;++i){
                for(j=0;j<=i;++j){
                        if(j==0||j==i) c.at(i).push_back(1);
                        else c.at(i).push_back((c.at(i-1).at(j-1)+c.at(i-1).at(j))%MOD);
                }
        }
  		if((x+y)%3!=0) cout << 0 << endl;
        else cout << c.at((x+y)/3).at((2*x-y)/3) << endl;
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> x >> y;
      |         ^~~
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<vector<ll>> c(x+y+1);
      |         ^~~~~~
a.cc:7:25: error: expected primary-expression before '>>' token
    7 |         vector<vector<ll>> c(x+y+1);
      |                         ^~
a.cc:7:28: error: 'c' was not declared in this scope
    7 |         vector<vector<ll>> c(x+y+1);
      |                            ^
a.cc:15:32: error: 'cout' was not declared in this scope
   15 |                 if((x+y)%3!=0) cout << 0 << endl;
      |                                ^~~~
a.cc:15:45: error: 'endl' was not declared in this scope
   15 |                 if((x+y)%3!=0) cout << 0 << endl;
      |                                             ^~~~
a.cc:16:14: error: 'cout' was not declared in this scope
   16 |         else cout << c.at((x+y)/3).at((2*x-y)/3) << endl;
      |              ^~~~
a.cc:16:53: error: 'endl' was not declared in this scope
   16 |         else cout << c.at((x+y)/3).at((2*x-y)/3) << endl;
      |                                                     ^~~~
Language: C++

/* Code by Saborit */
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast") 
#define MX 100005
#define INF (1<<30)
#define EPS 1e-9
#define MOD 1000000007
#define mid (x+xend)/2
#define izq nod*2
#define der nod*2+1
#define fr first
#define sc second
#define pb push_back
#define mp make_pair
#define all(X) (X).begin(), (X).end()
#define unique(X) (X).resize(unique(all(X)) - (X).begin())
#ifdef LOCAL 
	#include "debug.h"
#endif
using namespace std;
using namespace __gnu_pbds;
typedef long long int64;
typedef unsigned long long unt64;

int64 pot(int64 base, int64 e){
	int64 ans = 1;
	
	while( e ){
		if( e & 1ll ) ans = ans * base % MOD;
		base = base * base % MOD;
		e >>= 1ll;
	}
	return ans;
}

int64 inv_mod(int a, int b){
	return a * pot(b, MOD-2) % MOD;
}

int x, y;

int main(void){
    //~ freopen("a.in", "r", stdin);
    //~ freopen("a.out", "w", stdout);
    
    scanf("%d%d", &x, &y);
    
    if( (x + y) % 3 != 0  )
		return !printf("0\n");
	
    int p = (x + y) / 3;
    int f = x - p;
	
	if( f < 0 || p - f < 0 )
		return !printf("0\n");
		
    db() << imie(p) imie(f) << imie(p-f);
    
    int64 fact = 1;
    for(int i=2; i<=p; i++){
		fact *= i;
		fact %= MOD;
	}
	
	int64 den = 1;
	for(int i=2; i<=f; i++){
		den *= i;
		den %= MOD;	
	}
	
	for(int i=2; i<=p-f; i++){
		den *= i;
		den %= MOD;	
	}
	
	//~ db() << imie(fact) imie(den);
	
	fact = inv_mod(fact, den);
	
	printf("%lld\n", fact);
    
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:5: error: 'db' was not declared in this scope; did you mean 'pb'?
   59 |     db() << imie(p) imie(f) << imie(p-f);
      |     ^~
      |     pb
a.cc:59:13: error: 'imie' was not declared in this scope
   59 |     db() << imie(p) imie(f) << imie(p-f);
      |             ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const long long INF = 1LL << 60;
const int mod=1e9+7;

int f(int n,int p){
  if(n==0){return 1;}
  int64_t x=f(n/2,p);x%=mod;
  x*=x;x%=mod;
  if(n%2!=0){x*=p;}
  x%=mod;
  return x;
}
 
int choose(int n,int a){
  int64_t u=1,d=1;
  for(int i=0;i<a;i++){
    u*=n-i;u%=mod;
    d*=i+1;d%=mod;
  }
  return u*f(mod-2,d)%mod;
}

int main() {
  int X,Y;
  cin>>X>>Y;
  if((X+Y)%3!=0){cout<<0<<endl;return 0;}
  int n=(X+Y)/3;
  if(X-n<0||Y-n<0){cout<<0<<endl;return 0;}
  cout<<choose(X-n+Y-n,X-n)<<endl;
  return 0;
}　

Compiler output:
a.cc:37:2: error: extended character 　 is not valid in an identifier
   37 | }　
      |  ^
a.cc:37:2: error: '\U00003000' does not name a type
   37 | }　
      |  ^~
Language: C++

#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>

// ===============================================================

using namespace std;
using ll = long long;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using vs = vector<string>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vm = vector<short>;
using vmm = vector<vector<short>>;
using pii = pair<int, int>;
using psi = pair<string, int>;
using ld = long double;
using ull = unsigned long long;

// ========================================================================

ll gcd(ll a, ll b)
{
	if (a % b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a % b));
	}
}
//最大公約数
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
//最小公倍数
ll box(double a)
{
	ll b = a;
	return b;
}
//切り捨て
ll fff(double a)
{
	ll b = a + 0.5;
	return b;
}
//四捨五入
ll sum(ll n) {
	return (1 + n) * n / 2;
}
//1から整数nまでの合計を出す
bool prime(ll a)//素数判定、primeならtrue,違うならfalse
{
	if (a < 2) return false;
	else if (a == 2) return true;
	else if (a % 2 == 0) return false;
	double m = sqrt(a);
	for (int i = 3; i <= m; i += 2)
	{
		if (a % i == 0)
		{
			return false;
		}
	}

	// 素数である
	return true;
}
//素数判定

ll modpow(ll a, ll n, ll mod) {
	ll hi = 1;
	while (n > 0) {
		if (n & 1) hi = hi * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return hi;
}
//いろいろやります（ただの前座）
ll mg(ll a, ll mod) {
	return modpow(a, mod - 2, mod);
}
//割り算の%INF対策で逆元を出します

//暇ですね(*'▽')

// ========================================================================

int main() {
	ll x, y; cin >> x >> y;
	ll n, m;
	ll ans = 1;
	ll cnt = 1;
	if ((x + y) % 3 != 0) cout << 0 << endl;
	else {
		m = (x * 2 - y) / 3;
		n = x - 2 * m;
		cnt = n + m;
		for (int i = 1; i <= n; i++) {//Nならいけないかな
			ans *= cnt;
			ans %= 1000000007;
			ans *= mg(i, 1000000007);
			ans %= 1000000007;
			cnt--;
		}
		else cout << ans << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:143:17: error: 'else' without a previous 'if'
  143 |                 else cout << ans << endl;
      |                 ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define vlli vector<ll>
#define vi vector<int>
#define vs vector<string>
#define vplli vector< pair< ll,ll> >
#define plli pair< ll,ll >
#define vps vector< pair< string, string> >
#define vpi vector< pair< int, int> >
#define all(x) x.begin(), x.end()
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define forn(i,a,n) for(ll i=a;i<n;i++)
#define scan(arr,a,n) for(ll i=(a);i<(n);i++)cin>>(arr)[i];
#define print(arr,a,n) for(ll i=(a);i<(n);i++)cout<<(arr)[i]<<" ";

ll add(ll x, ll y) {ll res = x + y; return (res >= mod ? res - mod : res);}
ll mul(ll x, ll y) {ll res = x * y; return (res >= mod ? res % mod : res);}
ll sub(ll x, ll y) {ll res = x - y; return (res < 0 ? res + mod : res);}
ll power(ll x, ll y) {ll res = 1; x %= mod; while (y) {if (y & 1)res = mul(res, x); y >>= 1; x = mul(x, x);} return res;}
ll mod_inv(ll x) {return power(x, mod - 2);}

ll ans = 0;

ll fn(ll x, ll y){
    cout<<x<<" "<<y<<endl;
    if(y == 0 && x == 0){
        return 1;
    }
    if(x<0){
        return 0;
    }
    if(y<0){
        return 0;
    }
    ans = add(fn(x-1, y-2) + fn(x-2, y-1));
    return ans;

}

int main(){
    fast;
    #ifndef ONLINE_JUDGE
    freopen("input1.txt","r",stdin);
    freopen("output1.txt","w",stdout);
    #endif
    ll x, y;
    cin >> x >> y;
    fn(x, y);
    cout<<ans%mod<<endl;
}

Compiler output:
a.cc: In function 'long long int fn(long long int, long long int)':
a.cc:41:14: error: too few arguments to function 'long long int add(long long int, long long int)'
   41 |     ans = add(fn(x-1, y-2) + fn(x-2, y-1));
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:22:4: note: declared here
   22 | ll add(ll x, ll y) {ll res = x + y; return (res >= mod ? res - mod : res);}
      |    ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define ff first
#define ss second
#define file_se_input  freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pp long long int
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define pb push_back
#define mp make_pair
#define pi 3.141592653589793238
#define eb emplace_back
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define zip(i,a,b) for(int i=a;i<b;i++)
#define rzip(i,a,b) for(int i=a;i>=b;i--)
#define ll unsigned long long int
#define test int t;cin>>t; while(t--)
#define um unordered_map
#define en '\n'
#define us unordered_set
typedef pair<int, int>     pii;
typedef pair<char, int>    pci;
typedef pair<char, char>   pcc;
typedef vector<pii>       vii;
typedef long double ld;
#define all(v) v.begin(), v.end()
#define INF (1e18+5)
#define inf (1e9+5)
#define mod 1000000007


bool check_prime(long long n)
{
	int flag = 0;
	for (long long i = 2; i * i <= n; i++)
	{
		if (n % i == 0)
		{
			flag = 1;
			break;
		}
	}
	if (n == 1)
		return false;
	else if (flag == 0 || n == 2 || n == 3)
	{
		return true;
	}
	else
	{
		return false;
	}

}

int BE(int x, int n, int m) //function to calculate x raise to power n modulo m
{
	int result = 1;
	while (n > 0)
	{
		if (n % 2 == 1)
			result = result * x % m;
		x = x * x % m;
		n = n / 2;
	}
	return result;
}

factorial_modulo(int n)
{
	int result = 1;
	rep(i, 1, n)
	{
		result = result * i % mod;
		result = result % mod;
	}
	return result % mod;
}

int dp1[1000002], dp2[1000002];
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	if (fopen("input.txt", "r"))
	{
		freopen ("input.txt" , "r" , stdin);
		freopen ("output.txt" , "w" , stdout);
	}
#endif
	//_______________________________-code starts-_______________________________________________

	int x, y;
	cin >> x >> y;
	if (x < y / 2)
	{
		//cout << "n" << en;
		cout << 0 << en;
	}
	else if (y < x / 2)
	{
		//cout << "o" << en;
		cout << 0 << en;
	}
	else if ((x + y) % 3)
	{
		//cout << "t" << en;
		cout << 0 << en;
	}
	else
	{
		int m = (2 * x - y) / 3;
		int n = (2 * y - x) / 3;
		//cout << m << en << n << en;
		int q = (factorial_modulo(m) % mod * factorial_modulo(n) % mod) % mod;
		int m1 = factorial_modulo(m) % mod;
		int n1 = factorial_modulo(n) % mod;
		// cout << "m1 " << m1 << en;
		// cout << "n1 " << n1 << en;
		q = (m1 * n1) % mod;
		q = q % mod;
		int q1 = BE(q, mod - 2, mod);
		int p = factorial_modulo(m + n);
		// cout << p << en;
		//cout << q << en;
		int ans = (p % mod * q1 % mod) % mod;
		cout << ans % mod << en;
	}


	return 0;
}



Compiler output:
a.cc:71:1: error: ISO C++ forbids declaration of 'factorial_modulo' with no type [-fpermissive]
   71 | factorial_modulo(int n)
      | ^~~~~~~~~~~~~~~~
Language: C++

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



using namespace std;

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

int x,y;
long long int cnt=0;
long long int ans=0;
int thresh = 5000;
long long int dp[thresh][thresh];
int null = -1;

long long int dfs(int i, int j){
    long long int res=0;
    // cout << i << " " << j << " " << endl;// dp[x-i][y-j] << endl;
    if(x >= i && y >= j && x-i < thresh && y-j < thresh) {
        if(dp[x-i][y-j] != null){
            // cout << 111 << endl;
            return dp[x-i][y-j];
        }
    }
    if(i == x && j == y){
        // cnt = (++cnt)/1000000007;
        // cout << 11111111 << endl;
        return 1;
    }
    else if(i>x || j>y){
        // cout << "hello";
        return 0;
    }
    else if((x-i)*2<y-j){
        res = dfs(i+2,j+1)%1000000007;
    }
    else if((y-j)*2<x-i){
        res = dfs(i+1,j+2)%1000000007;
    }
    else{
        // cout << 2222222 << endl;
        res = (dfs(i+1, j+2) + dfs(i+2,j+1))%1000000007;
    }
    // cout << 3333 << endl;

    if(x-i < thresh && y-j < thresh && x >= i && y >= j){
        dp[x-i][y-j] = res;
    }
    return res;
}

int main(){
    cin >> x >> y;
    rep(i,thresh){
        rep(j,thresh){
            dp[i][j] = null;
        }
    }
    if(x - thresh > 0 && y - thresh > 0 ){
        ans = dfs(x-thresh,y-thresh);
    }
    ans = dfs(0,0);
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc:19:26: error: size of array 'dp' is not an integral constant-expression
   19 | long long int dp[thresh][thresh];
      |                          ^~~~~~
a.cc:19:18: error: size of array 'dp' is not an integral constant-expression
   19 | long long int dp[thresh][thresh];
      |                  ^~~~~~
Language: C++

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



using namespace std;

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

int x,y;
long long int cnt=0;
long long int ans=0;

long long int dp[1000][1000];
int null = -1;

long long int dfs(int i, int j){
    long long int res=null;
    // cout << i << " " << j << " " << dp[x-i][y-j] << endl;
    if(i == x && j == y){
        // cnt = (++cnt)/1000000007;
        return 1;
    }
    else if(i>x || j>y){
        return 0;
    }
    else if(x >= i && y >= j) {
        if(dp[x-i][y-j] != null) return dp[x-i][y-j];
    else if((x-i)*2<y-j){
        res = dfs(i+2,j+1)%1000000007;
    }
    else if((y-j)*2<x-i){
        res = dfs(i+1,j+2)%1000000007;
    }
    else{
        res = (dfs(i+1, j+2) + dfs(i+2,j+1))%1000000007;
    }
    if(x-i < 1000 && y-j < 1000 && x >= i && y >= j){
        dp[x-i][y-j] = res;
    }
    return res;
}

int main(){
    cin >> x >> y;
    rep(i,1000){
        rep(j,1000){
            dp[i][j] = null;
        }
    }
    ans = dfs(x/10,y/10);
    ans = dfs(0,0);
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'long long int dfs(int, int)':
a.cc:49:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   49 | int main(){
      |         ^~
a.cc:49:9: note: remove parentheses to default-initialize a variable
   49 | int main(){
      |         ^~
      |         --
a.cc:49:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:49:11: error: a function-definition is not allowed here before '{' token
   49 | int main(){
      |           ^
a.cc:61:2: error: expected '}' at end of input
   61 | }
      |  ^
a.cc:22:32: note: to match this '{'
   22 | long long int dfs(int i, int j){
      |                                ^
a.cc:61:2: warning: control reaches end of non-void function [-Wreturn-type]
   61 | }
      |  ^
Language: C++

//---------------------------------------------------------------
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
//---------------------------------------------------------------
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define SIZE 100005
#define INF 1000000000000000LL
#define all(x) x.begin(),x.end()
using pint = pair<int,int>;
using vec = vector<int>;
using ll=long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
//---------------------------------------------------------------
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//---------------------------------------------------------------

//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

int dp(int n, int k) {

  long long MOD = 1e9 + 7;
  vector<vector<int>> dp(n + 1, vector<int>(n + 1, 0));
  
  for(int i = 0; i <= n; i++) {
    dp[i][0] = 1;
    for(int j = 1; j <= i; j++) {
      dp[i][j] = (dp[i - 1][j - 1] + dp[i - 1][j]) % MOD;
    }
  }
  return dp[n][k];
}

int main() {

    
    ios::sync_with_stdio(false);
    cin.tie(0);

    int x,y;cin>>x>>y;
    if((x+y)%3 != 0){
        cout<<"0"<<endl;
        return 0;
    } 

    int n = (-x+2*y)/3;
    int m = (2*x - y)/3;

    auto ans= dp[n+m][m]/(1e10+7);

    cout<<ans<<endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:21: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   62 |     auto ans= dp[n+m][m]/(1e10+7);
      |                     ^
a.cc:62:24: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   62 |     auto ans= dp[n+m][m]/(1e10+7);
      |                        ^
a.cc:62:25: error: invalid operands of types 'int(int, int)' and 'double' to binary 'operator/'
   62 |     auto ans= dp[n+m][m]/(1e10+7);
      |               ~~~~~~~~~~^~~~~~~~~
      |                        |      |
      |                        |      double
      |                        int(int, int)
Language: C++

#include <bits/stdc++.h>
using namespace std;
using  LL = long long;
LL yhaa(LL x, LL n, LL mod){
    if (n == 0){
        return 1;
    }
    if (n%2 == 0){
        LL t = (yhaa(x,n/2, mod)) % mod;//偶数の時は半分
        return (t*t) % mod;
    }
    return (x * yhaa(x, n-1, mod)) % mod;
}

LL nCk(LL n,LL k,LL m){
    int K;
    if (2*k > n){
        K  = n - k;
    }
    else{
        K = k;
    }
    LL X = 1;
    for(int i = 0; i < K;i++){
        X = (X*(n-i)) % m;
    }
    LL Y = 1;
    for(int i = 1; i < K+1; i++){
        Y = (Y*i) % m;
    }
    LL YY = yhaa(Y,1000000005,m);
    return (X*YY) % m;

}
int main(){
    int X, Y;
    cin >> X >> Y;
    int a, b;
    LL ans; 
    ans = 0;
    if (X*Y != 0){
        if ((X+Y) % 3 == 0){
            a = (2*X - Y) / 3;
            b = Y - 2*a;
            if (a > 0){
                if b > 0){
                    ans = nCk(a+b,min(a,b),1000000007);
                }
            }
            
        }
    }

    cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:20: error: expected '(' before 'b'
   46 |                 if b > 0){
      |                    ^
      |                    (
Language: C++

1>------ ビルド開始: プロジェクト: aaa, 構成: Debug Win32 ------
2>------ ビルドのスキップ: プロジェクト:samplecode, 構成: Debug Win32 ------
2>プロジェクトはこのソリューション構成に対してビルドするように選択されていません。 


Compiler output:
a.cc:3:3: error: extended character 。 is not valid in an identifier
    3 | 2>プロジェクトはこのソリューション構成に対してビルドするように選択されていません。
      |   ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1>------ ビルド開始: プロジェクト: aaa, 構成: Debug Win32 ------
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
typedef long long int lli;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};

ll mod = 1000000007;

ll modpow(ll x, ll n){
    if ( n == 0 ) return 1;
    if (n % 2 == 0){
        ll half = modpow(x, n/2);
        return half * half % mod;
    }else{
        return x * modpow(x, n-1) % mod;
    }
}

ll choose(ll n, ll r){
    ll mul = 1;
    ll div = 1;
    for(int i = 0; i < r; i++){
        mul *= n - i;
        div *= i + 1;
        mul %= mod;
        div %= mod;
    }
    return mul * modpow(div, mod-2) % mod;
}

int main(){
    ll x;
    ll y;
    cin >> x >> y;
    if ((x + y) % 3 != 0) {
        cout << 0 << endl;
        return 0;
    }
    ll n = (x + y) / 3;
    x -= n;
    y -= n;
    if (x < 0 || y < 0){
        cout << ans << endl;
        return 0;
    }
    ll ans = choose(x + y, x);
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   52 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

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

const int m = 1e6, M = 1e9+7;
ll inverse[3*m], fact[3*m], invfact[3*m];

ll nCr(ll n, ll r){
    ll ans = fact[n]*invfact[r]%M;
    return (ans*invfact[n-r]%M); 
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    //good luck, kittu

    inverse[1] = 1;
    for(ll i = 2; i<3*m; i++) inverse[i] = M - M/i * inverse[M%i]%M;
    fact[0] = invfact[0] = 1;
    for(ll i = 1; i<3*m; i++){
        fact[i] = fact[i-1]*i%M;
        invfact[i] = invfact[i-1]*inverse[i]%M;
    }

    ll x, y; cin>>x>>y;
    if((x+y)%3!=0) return cout<<"0\n", 0;

    ll n = (2*y - x)/3, m = (2*x - y)/3;
    if(n<0 || m<0) return cout<<"0\n";
    
    ll ans = nCr(n+m, n);
    ans %= M;
    cout<<ans<<"\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:31: error: cannot convert 'std::basic_ostream<char>' to 'int' in return
   31 |     if(n<0 || m<0) return cout<<"0\n";
      |                           ~~~~^~~~~~~
      |                               |
      |                               std::basic_ostream<char>
Language: Java

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

//    	File file = new File("src/in.txt");
//    	Scanner sc = new Scanner(file);

    	Scanner sc = new Scanner(System.in);

    	int X = sc.nextInt();
    	int Y = sc.nextInt();
    	long p = 1000000007;

    	int a = 2*X-Y;
    	int b = 2*Y-X;

    	if(a<0||(a%3!=0)||b<0||(b%3!=0)) {
    		System.out.println("0");
    	} else {
    		a /= 3;
    		b /= 3;
    		if(a<b) {
    			int tmp = a;
    			a = b;
    			b = tmp;
    		}
    		long times = 1;
    		for(int i = b+1;i<=a+b;i++) {
    			times *= i;
    			times = times %p;

    		}
    		long fracA = 1;
    		for(int i=1;i<=a;i++) {
    			fracA *= i;
    			fracA = fracA%p;
    		}
    		long times2 = modPow(fracA,p-2,p);
    		if(times*times2<p) {
    			System.out.println(times*times2);
    		} else {
    			System.out.println((times*times2)%p);
    		}
    	}
    }
    public static final long modPow(long x, long n, final long mod) {
        long sum = 1;
        while (n > 0) {
            if ((n & 1) == 1) {      //ビットが立っていたら
                sum = sum * x % mod; //x^2^k1 * x^2^k2 * x^2^k3 * ・・・
            }
            x = x * x % mod;         //((x^2)^2)^2 ・・・
            n >>= 1;
        }
        return sum;
    }

}

Compiler output:
Main.java:2: error: cannot find symbol
    public static void main(String[] args) throws FileNotFoundException {
                                                  ^
  symbol:   class FileNotFoundException
  location: class Main
Main.java:7: error: cannot find symbol
    	Scanner sc = new Scanner(System.in);
    	^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
    	Scanner sc = new Scanner(System.in);
    	                 ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: C++

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

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};

int main() {
  int x,y;
  cin >> x >> y;
  if ((x+y)%3) {
    cout << 0 << endl;
    return 0;
  }
  int n = (x+y)/3;
  x-=n; y-=n;
  if(x<0 || y<0) {
    cout << 0 << endl;
    return 0;
  }
  combination c(x+y);
  mint ans = c(x+y, x);
  cout << ans.x << endl;
  return 0;
}

Compiler output:
a.cc:11:11: error: redefinition of 'const int mod'
   11 | const int mod = 998244353;
      |           ^~~
a.cc:10:11: note: 'const int mod' previously defined here
   10 | const int mod = 1000000007;
      |           ^~~
Language: C++

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

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};

int main() {
  int x,y;
  cin >> x >> y;
  if ((x+y)%3) {
    cout << 0 << endl;
    return 0;
  }
  int n = (x+y)/3;
  x-=n; y-=n;
  if(x<0||y<0) {
    cout << 0 << endl;
    return 0;
  }
  combination c(x+y);
  mint ans = c(x+y, x);
  cout << ans.x << endl;
  return 0;
}

Compiler output:
a.cc:68:11: error: stray '\20' in program
   68 |   if(x<0||<U+0010>y<0) {
      |           ^~~~~~~~
a.cc:11:11: error: redefinition of 'const int mod'
   11 | const int mod = 998244353;
      |           ^~~
a.cc:10:11: note: 'const int mod' previously defined here
   10 | const int mod = 1000000007;
      |           ^~~