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

#include <bits/stdc++.h>
#define LL long long
#define maxn 100005
#define modn  100000007;
using namespace std;
LL quickpow(LL a,LL b)
{
    LL ans=1;
    while(b>0)
    {
        if(b%2==1)
           {
               ans=ans*a;
               ans%=modn;
           }
        a=a*a;
        a%=modn;
        b/=2;
    }
    return ans;
}
LL slove(LL x,LL y)
{
     LL xx=((x+y)/3)*2;
     LL yy=((x+y)/3)*2;
     LL ans1=quickpow(2,xx-x);
     LL ans2=quickpow(2,yy-y);
    
     return min(ans1,ans2);
}
int main()
{
     LL x,y;
     while(scanf("%lld%lld",&x,&y)!=EOF)
     {
         
         ans=slove(x,y);
         cout<<ans<<endl;
     }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   37 |          ans=slove(x,y);
      |          ^~~
      |          abs
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 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 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   24 |         cout<<c%(pow(10,9)+7)<<endl;
      |               ~^~~~~~~~~~~~~~
      |               |           |
      |               int         __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

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


long long 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:21:16: error: no matching function for call to 'pow(long long int)'
   21 |         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;
  if((2*y-x>=0)&&(2*x-y>=0)&&((2*x-y)%3)==0&&((2*y-x)/3==0)){
    int k=(2*y-x)/3;
    int l=(2*x-y)/3;
    if(k!=0&&l!=0){
      int st, lt;
      st=1;
      for(int d=1;d<k+1;d++){
        st=st*d;// k!
      }
      lt=1;
      for(int r=l+1; r<k+l+1;r++){
        lt=lt*r;
      }
      int fj=lt/st;
      int vd=fj%1000000007;
      cout<<vd<<endl;
    }
    else if(k==0||l==0){
      cout<<1<<endl;
    
  }
  else{
    cout<<0<<endl;
  }
}

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

#include <iostream>
#include <cmath>

typedef long long ll;
const ll mod = 1e9 + 7;

using namespace std;

ll fact_mod(ll x, ll y){
  if (x <= y) return max((ll)1, x);
  else return x * fact_mod(x - 1, y) % mod;
}

ll xgcd(ll a, ll b){
  ll x0 = 1, y0 = 0, x1 = 0, y1 = 1;
  ll q;
  while (b != 0){
    q = a / b;
    ll tmp = b;
    b = a % b;
    a = tmp;
    ll tmpx = x1;
    ll tmpy = y1;
    x1 = x0 - q * x1;
    y1 = y0 - q * y1;
    x0 = tmpx;
    y0 = tmpy;
    cerr << b << endl;
  }
  cerr << x0 << endl;
  return x0;
}

ll inv_mod(ll x, ll m){
  return xgcd(x, m) % m;
}

ll pow_mod(ll x, ll p){
  ll ans = 1;
  for (int i=0; i<p; i++){
    ans = (ans * x) % mod;
  }
  return ans;
}

ll inv_mod2(ll x, ll m){
  return pow_mod(x, m - 2);
}

int main(){
  ll X, Y;
  cin >> X >> Y;
  if ((X % 3 == 0 && Y % 3 == 0) || 
      (X % 3 == 1 && Y % 3 == 2) ||
      (X % 3 == 2 && Y % 3 == 1)){
    ll diff = X - Y;
    ll ans = 0;
    if (diff == 0){
      if (X / 3 == 1){
        ans = fact_mod(X / 3 * 2, X / 3);
      }
	  else{
      	ans = (fact_mod(X / 3 * 2, X / 3 + 1) * inv_mod(fact_mod(X / 3, 1), mod)) % mod;
      }
    }
    else if (diff < 0){
      ans = (fact_mod(X / 3 * 2, X / 3 + abs(diff) + 1) * inv_mod(fact_mod(X / 3 - abs(diff), 1), mod)) % mod;
    }
    else (diff < 0){
      ans = (fact_mod(Y / 3 * 2, Y / 3 + abs(diff) + 1) * inv_mod(fact_mod(Y / 3 - abs(diff), 1), mod)) % mod;
    }
    cout << ans << endl;
  }
  else{
    cout << 0 << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:20: error: expected ';' before '{' token
   69 |     else (diff < 0){
      |                    ^
      |                    ;
Language: C++

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

int main(){
    int X,Y;
    cin >> X >> Y;
    vector<vector<int>> way(X+1,vector<int>(Y+1));
    /*
    for(int i=0;i<=X;i++){
        for(int j=0;j<=Y;j++){
            way.at(i).at(j) = 0;
        }
    }
    */
    way.at(1).at(2) = 1;
    way.at(2).at(1) = 1;
/*
    for(int i=2;i<=X;i++){
        for(int j=2;j<=Y;j++){
            int tmp;
            tmp = way.at(i-2).at(j-1) + way.at(i-1).at(j-2);
            way.at(i).at(j) = tmp;
        }
    }
*/

    int i=1,j=2;

    while(i <= X && j <= Y){
        way.at(i).at(j) += 1;
        i += 1;
        j += 2;
    }

    int i=2,j=1;
    while(i <= X && j <= Y){
        way.at(i).at(j) += 1;
        i += 2;
        j += 1;
    }


    cout << way.at(X).at(Y) % 1000000007 << endl;

    return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: redeclaration of 'int i'
   36 |     int i=2,j=1;
      |         ^
a.cc:28:9: note: 'int i' previously declared here
   28 |     int i=1,j=2;
      |         ^
a.cc:36:13: error: redeclaration of 'int j'
   36 |     int i=2,j=1;
      |             ^
a.cc:28:13: note: 'int j' previously declared here
   28 |     int i=1,j=2;
      |             ^
Language: C++

#include<iostream>
#include<cmath>
#define MOD 1000000007

using namespace std;

long long power(long long a,long long x){
    return x?x%2?power(a,x-1)*a%MOD:(long long)powl(power(a,x/2),2)%MOD:1;
}
long long nCr(long long n,long long r){
    long long nCr=1LL;
    for(long long i=n;i>n-r;nCr%=MOD,i--)nCr*=i;
    for(long long i=1;i<=r;nCr%=MOD,i++)nCr*=power(i,MOD-2);
    return nCr;
}


int main(){
    long long x,y;
    cin>>x>>y;
    long long r=(2*y-x)/3LL,n=r+(y-2*r);
    if((2*y-x)%3!=0LL||r<0||n<=0{cout<<0<<endl;return 0;}

    cout<<nCr(n,r)<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:33: error: expected ';' before '{' token
   22 |     if((2*y-x)%3!=0LL||r<0||n<=0{cout<<0<<endl;return 0;}
      |                                 ^
      |                                 ;
a.cc:24:25: error: expected ')' before ';' token
   24 |     cout<<nCr(n,r)<<endl;
      |                         ^
      |                         )
a.cc:22:7: note: to match this '('
   22 |     if((2*y-x)%3!=0LL||r<0||n<=0{cout<<0<<endl;return 0;}
      |       ^
Language: C++

#include<bits/stdc++.h>
#define P 1000000007ll
#define MAXN 1000007ll
using namespace std;
typedef long long ll;

ll exgcd(ll a, ll b, ll &x, ll &y){
    if(!b){
        x = 1, y = 0;
        return a;
    }else{
        ll r = exgcd(b, a % b, x, y);
        ll t = x;
        x = y;
        y = t - a / b * y;
        return r;
    }
}

ll ru[MAXN];

int main(){
    memset(ru, 0, sizeof(ru));
    ll x, y;
    cin >> x >> y;
    if((x + y) % 3){
        cout << 0 << endl;
        return 0;
    }
    ll a = (2 * y - x) / 3, b = (2 * x - y) / 3;
    ll xx = 0, buf;
    if(a < b)
        swap(a, b);
    for(register ll i = 1; i <= b; ++i){
        buf = exgcd(i, P, ru[i], xx);
    }
    ll ans = 1;
    for(register ll i = a + 1; i <= a + b; ++i){
        ans *= i;
        ans %= P;
    }
    for(register ll i = 1; i <= b; ++i){
        ans *= ru[i];
        ans %= P;
    }
    cout << ans % p << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   34 |     for(register ll i = 1; i <= b; ++i){
      |                     ^
a.cc:38:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   38 |     for(register ll i = a + 1; i <= a + b; ++i){
      |                     ^
a.cc:42:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   42 |     for(register ll i = 1; i <= b; ++i){
      |                     ^
a.cc:46:19: error: 'p' was not declared in this scope
   46 |     cout << ans % p << endl;
      |                   ^
Language: C++

#include <iostream>
using namespace std;


long long 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:13: error: 'pow' was not declared in this scope
   20 |         cvp=pow(faktoriyel[sira]*faktoriyel[bas-x]*faktoriyel[sira-bas+x])%1000000007,1000000005)%1000000007;
      |             ^~~
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 long long int MAX=1000000000;

ll fact[MAX], fact_inv[MAX];

ll power(ll a, ll b){
	ll res=1;
	while(b>0){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}

ll comb(ll n, ll r){
	return (fact[n]*fact_inv[r])%MOD*fact_inv[n-r]%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(){
	int n=1000000;
	// cin>>n;
	fact[0]=1;
        // 階乗の計算
	REP(i, n) fact[i+1]=fact[i]*(i+1)%MOD;
	fact_inv[n]=power(fact[n], MOD-2);
        // 逆元の計算
	FORR(i, 0, n) fact_inv[i]=fact_inv[i+1]*(i+1)%MOD;

	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 <<comb(cy,cx)<<endl;
}


Compiler output:
/tmp/cc89BT3N.o: in function `comb(long long, long long)':
a.cc:(.text+0xf9): relocation truncated to fit: R_X86_64_PC32 against symbol `fact_inv' defined in .bss section in /tmp/cc89BT3N.o
a.cc:(.text+0x14a): relocation truncated to fit: R_X86_64_PC32 against symbol `fact_inv' defined in .bss section in /tmp/cc89BT3N.o
/tmp/cc89BT3N.o: in function `main':
a.cc:(.text+0x2a1): relocation truncated to fit: R_X86_64_PC32 against symbol `fact_inv' defined in .bss section in /tmp/cc89BT3N.o
a.cc:(.text+0x2c7): relocation truncated to fit: R_X86_64_PC32 against symbol `fact_inv' defined in .bss section in /tmp/cc89BT3N.o
a.cc:(.text+0x31e): relocation truncated to fit: R_X86_64_PC32 against symbol `fact_inv' defined in .bss section in /tmp/cc89BT3N.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
 int a,b;
 cin>>a>>b;
 int c,d;
 if(a>b){c=a-b; b=b-c; cout<<((b*2)/3)+c;}
 else if(a=b){b=b/3; cout<<b*2;}
 else if{c=b-a; a=a-c; cout<<((a*2)/3)+c;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: expected '(' before '{' token
   10 |  else if{c=b-a; a=a-c; cout<<((a*2)/3)+c;}
      |         ^
      |         (
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#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 c=0;
	rep(i, y){
		if(3*i==x){
			c+=kai(i);
		}
	}
	cout<<c%10^9+7<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   24 |         cout<<c%10^9+7<<endl;
      |                    ~~~^~~~~~
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=1000000000;

ll fact[MAX], fact_inv[MAX];

ll power(ll a, ll b){
	ll res=1;
	while(b>0){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}

ll comb(ll n, ll r){
	return (fact[n]*fact_inv[r])%MOD*fact_inv[n-r]%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(){
	int n=1000000;
	// cin>>n;
	fact[0]=1;
        // 階乗の計算
	REP(i, n) fact[i+1]=fact[i]*(i+1)%MOD;
	fact_inv[n]=power(fact[n], MOD-2);
        // 逆元の計算
	FORR(i, 0, n) fact_inv[i]=fact_inv[i+1]*(i+1)%MOD;

	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 <<comb(cy,cx)<<endl;
}


Compiler output:
/tmp/cczvvDub.o: in function `comb(long long, long long)':
a.cc:(.text+0xf9): relocation truncated to fit: R_X86_64_PC32 against symbol `fact_inv' defined in .bss section in /tmp/cczvvDub.o
a.cc:(.text+0x14a): relocation truncated to fit: R_X86_64_PC32 against symbol `fact_inv' defined in .bss section in /tmp/cczvvDub.o
/tmp/cczvvDub.o: in function `main':
a.cc:(.text+0x2a1): relocation truncated to fit: R_X86_64_PC32 against symbol `fact_inv' defined in .bss section in /tmp/cczvvDub.o
a.cc:(.text+0x2c7): relocation truncated to fit: R_X86_64_PC32 against symbol `fact_inv' defined in .bss section in /tmp/cczvvDub.o
a.cc:(.text+0x31e): relocation truncated to fit: R_X86_64_PC32 against symbol `fact_inv' defined in .bss section in /tmp/cczvvDub.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
   int x,y,f=0,c=0,ans;
   cin>>x>>y;
  
   if(x==y)
   {
       if(x%3==0)
       {
           cout<<pow(2,x/3)/1000000007;
           return 0;
       }
       else
       return 0;
   }
   if(y>x)
   {
       x=y;
   }
   
       int a=x;
       int b=y;
       a--;
       b=b-2;
       while(a>=0 && b>=0)
       {
           c++;
           if(a==b)
           {
               f=1;
               break;
           }
           b--;
           a=a-2;
       }
  // c=0;
      int a1=x;
       int b1=y;
    
   if(f==0)
   {
             while(a1>=0 && b1>=0)
       {
           //c++;
           if(a1==b1)
           {
               f=2;
               break;
           }
           b1--;
           a1=a1-2;
       }
   }
   
   int fact=1;
   for(int i=2;i<=a/3+1;i++)
   {
       fact=fact*i;
   }
   
     if(f==1)
   {
       if(a%3==0)
       {
           ans=(pow(2,a/3)*c*fact)%(1000000007);
           cout<<ans;
       }
   }
   
   if(f==2)
   {
       ans=(pow(2,a1/3)*fact)%(1000000007);
       cout<<ans;
   }
   
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:67:35: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   67 |            ans=(pow(2,a/3)*c*fact)%(1000000007);
      |                ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
      |                             |       |
      |                             |       int
      |                             __gnu_cxx::__promote<double>::__type {aka double}
a.cc:74:30: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   74 |        ans=(pow(2,a1/3)*fact)%(1000000007);
      |            ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
      |                        |       |
      |                        |       int
      |                        __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <limits>
#include <algorithm>
#include <map>

using namespace std;

#define repd(i,a,b) for (int i=(a);i<(b);++i)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
int mod = 1000000007;

vector<ll> fac(1000001); //n!(mod M)
vector<ll> ifac(1000001); //k!^{M-2} (mod M)

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] % mod;
    return tmp * fac[a] % mod;
}

int main(int argc, const char * argv[]) {

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

  ll ans=0;
  ll a = (2*y - x) / 3;
  ll b = (y - 2*a);
  ans = comb(a+b, b) % mod;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'll mpow(ll, ll)':
a.cc:22:31: error: 'M' was not declared in this scope
   22 |         if(n&1) ans = ans*x % M;
      |                               ^
a.cc:23:19: error: 'M' was not declared in this scope
   23 |         x = x*x % M;
      |                   ^
Language: C

#include <stdio.h>
long int factorial(long int num) {
  long int sol = 1;
  for (long int n = 0; n < num; n++) {
    sol = sol * (n + 1);
  }
  return sol;
}

long int main(void) {
  long int x, y;
  long int r = scanf("%ld %ld", &x, &y);
  long int move = (long int)(x + y) / 3;
  long int abs = y - x;
  prlong int f("%ld", (factorial(move) /
                       (factorial((move - abs) / 2) *
                        factorial((move - abs) / 2 + abs)) %
                       1000000007));
}

Compiler output:
main.c: In function 'main':
main.c:15:3: error: 'prlong' undeclared (first use in this function)
   15 |   prlong int f("%ld", (factorial(move) /
      |   ^~~~~~
main.c:15:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:9: error: expected ';' before 'int'
   15 |   prlong int f("%ld", (factorial(move) /
      |         ^~~~
      |         ;
Language: C++

// ~maqsat~
/*
*/

// #pragma GCC target ("avx2")
// #pragma GCC optimization ("Ofast")
// #pragma GCC optimization ("unroll-loops")

// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

const ll N = 4e6 + 345;
const ll MOD = 1e9 + 7;

#define int ll

ll f[N];

inline ll binpow(ll a, ll n) {
	ll res = 1;
	while(n > 0) {
		if(n % 2 == 1) res = res * a % MOD;
		a = a * a % MOD;
		n /= 2;
	}
	return res;
}

signed main() {
    fre("");
    ACCELERATE;

    f[0] = f[1] = 1ll;
    for(ll i = 2; i <= N-300; i++) f[i] = (f[i-1] * i) % MOD;

    ll x, y;
    cin >> x >> y;

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

    ll n = (x + y)/ 3;
    ll k = (x - y + n) / 2;

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

	cout << f[n] * binpow(f[k], MOD-2ll) % MOD * binpow(f[n-k], MOD-2ll) % MOD;

    return 0;
}
/*
 
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'fre' was not declared in this scope; did you mean 'free'?
   37 |     fre("");
      |     ^~~
      |     free
a.cc:38:5: error: 'ACCELERATE' was not declared in this scope
   38 |     ACCELERATE;
      |     ^~~~~~~~~~
Language: Java

import java.util.Scanner;

public class D {

	private static final int MAX = 10000000;
	private static final long[] fac = new long[MAX];
	private static final long[] finv = new long[MAX];
	private static final long[] inv = new long[MAX];
	private static final int MOD = 1_000_000_007;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		sc.close();

		int n = x+y;
		if(n%3 != 0){
			System.out.println(0);
			return;
		}
		COMinit();
		if(x == y * 2){
			System.out.println(COM(n/3,x-y));
		}else if(x == y){
			System.out.println(COM(n/3, n/6));
		}else if(x*2 == y) {
			System.out.println(COM(n/3,y-x));
		}else if(x > y){
			System.out.println(COM(n/3,x-y+1));
		}else{
			System.out.println(COM(n/3,y-x+1));
		}
	}

	private static void COMinit() {
		fac[0] = fac[1] = 1;
		finv[0] = finv[1] = 1;
		inv[0] = 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;
		}
	}
	private static 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;
	}
}

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

#include <stdio.h>
int factorial(int num) {
  int sol = 1;
  for (int n = 0; n < num; n++) {
    sol = sol * (n + 1);
  }
  return sol;
}

int main(void) {
  int x, y;
  scanf("%d %d", &x, &y);
  int move = (int)(x + y) / 3;
  abs = y - x;
  printf("%d",
        (factorial(move) /
         (factorial((move - abs) / 2) * factorial((move - abs) / 2 + abs)) %
         1000000007));
}

Compiler output:
main.c: In function 'main':
main.c:14:3: error: 'abs' undeclared (first use in this function)
   14 |   abs = y - x;
      |   ^~~
main.c:14:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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



int main(){
  int x, y;
  cin>>x>>y;
  if(2*y-x>=0&&2*x-y>=0&&(2*x-y)%3==0&&(2*y-x)/3==0){
    int k=(2*y-x)/3;
    int l=(2*x-y)/3;
    if(k!=0&&l!=0){
      int st, lt;
      st=1;
      for(int d=1,d<k+1;d++){
        st=st*d;// k!
      }
      lt=1;
      for(int r=l+1; r<k+l+1;r++){
        lt=lt*r;
      }
      int fj=lt/st;
      int vd=fj%1000000007;
      cout<<vd<<endl;
    }
    else if(k==0){
      cout<<1<<endl;
    }
    else if(l==0){
      cout<<1<<endl;
    }
  }
  else{
    cout<<0<<endl;
  }
}
  
        
      
    

Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: expected ';' before '<' token
   15 |       for(int d=1,d<k+1;d++){
      |                    ^
      |                    ;
a.cc:15:20: error: expected primary-expression before '<' token
Language: Java

import java.util.*;
public class Main{
   public static void main(String[] args) {
     Scanner sc = new Scanner(System.in);
     int x = sc.nextInt();
     int y = sc.nextInt();
     long ans=1;
     int p;
     int s,u,v;
    if((x+y)%3==0){
      u = (x+y)/3;//goukeikaisuu
      v = Math.abs(x-y);//sanokaisuu
      if(u%2 == v%2){
        s = (u+v)/2;
        for( int ns = u , ms = 1; ms <= s; ns ++, ms ++ ) {
          ans *= ns;
          ans %= p;
          ans /= ms;
        }
      }else{
        ans = 0;
      }
    }else{
      ans = 0;
    }
    p = (int)Math.pow(10,9)+7;
     System.out.println(ans%p);
   }

   
}


Compiler output:
Main.java:17: error: variable p might not have been initialized
          ans %= p;
                 ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
using in = int64_t;

in are(in s,in t){
  duble ret=1ll;
for(in i=s+t;i>s;i--){
  ret *=i;
}
  
  for(in i=1;i<t+1;i++){
  ret /=i;
  }
  return ret;
}

int main(){
in x,y;
  cin>>x>>y;
  
  in xx,yy;
  xx=2*x-y;
  yy=2*y-x;
  if(xx%3==0 && yy%3==0){
     in s= yy/3;
     in t= xx/3;
    in ss= max(s,t);
    in tt = min(s,t);
    in ans = are(ss,tt);
    cout<<ans%waru<<endl;
  }
  else cout<<0<<endl;
}

Compiler output:
a.cc: In function 'in are(in, in)':
a.cc:10:3: error: 'duble' was not declared in this scope; did you mean 'double'?
   10 |   duble ret=1ll;
      |   ^~~~~
      |   double
a.cc:12:3: error: 'ret' was not declared in this scope; did you mean 'rep'?
   12 |   ret *=i;
      |   ^~~
      |   rep
a.cc:16:3: error: 'ret' was not declared in this scope; did you mean 'rep'?
   16 |   ret /=i;
      |   ^~~
      |   rep
a.cc:18:10: error: 'ret' was not declared in this scope; did you mean 'rep'?
   18 |   return ret;
      |          ^~~
      |          rep
Language: C++

#include<bits/stdc++.h> 

using namespace std;
typedef long long ll;

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;

	if(x%3==0&&y%3==0&&x==y){
		cout<<modfact(x/3,p)/modfact(x/6,p)/modfact(x/6,p);

	}
	else {
		if((x-2)%3==0&&(y-1)%3==0&&x-2==y-1){
			cout<<modfact((x-2)/3+1,p)/modfact((x-2)/6,p)/mdfact((x-2)/6+1,p);
		}
		else if((y-2)%3==0&&(x-1)%3==0&&x-1==y-2){
			cout<<modfact((x-1)/3+1,p)/modfact((x-1)/6,p)/mdfact((x-1)/6+1,p);
		}
		else{
			cout<<0;
		}

	}



	
	
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:23: error: 'modfact' was not declared in this scope; did you mean 'modFact'?
   52 |                 cout<<modfact(x/3,p)/modfact(x/6,p)/modfact(x/6,p);
      |                       ^~~~~~~
      |                       modFact
a.cc:57:31: error: 'modfact' was not declared in this scope; did you mean 'modFact'?
   57 |                         cout<<modfact((x-2)/3+1,p)/modfact((x-2)/6,p)/mdfact((x-2)/6+1,p);
      |                               ^~~~~~~
      |                               modFact
a.cc:57:71: error: 'mdfact' was not declared in this scope; did you mean 'modFact'?
   57 |                         cout<<modfact((x-2)/3+1,p)/modfact((x-2)/6,p)/mdfact((x-2)/6+1,p);
      |                                                                       ^~~~~~
      |                                                                       modFact
a.cc:60:31: error: 'modfact' was not declared in this scope; did you mean 'modFact'?
   60 |                         cout<<modfact((x-1)/3+1,p)/modfact((x-1)/6,p)/mdfact((x-1)/6+1,p);
      |                               ^~~~~~~
      |                               modFact
a.cc:60:71: error: 'mdfact' was not declared in this scope; did you mean 'modFact'?
   60 |                         cout<<modfact((x-1)/3+1,p)/modfact((x-1)/6,p)/mdfact((x-1)/6+1,p);
      |                                                                       ^~~~~~
      |                                                                       modFact
Language: C++

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

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}



int main(){
    ll x,y,sum,n,m,i,j,ans,dekai,yabai,yabee;
    dekai = 1000000007;
    bool judge = false;
    cin >> x >> y;
    sum = x+y;
    if(sum % 3 == 0){
        judge = true;
    }
    if(judge){
        n = (2*y-x)/3;
        m = (2 * x-y)/3;
      if(n < 0 || m < 0){
        ans = 0; 
        break;
      }
        //ans = kaijou[n+m]/(kaijou[n]*kaijou[m]);
        ll kaijou[n+m+1];
        kaijou[0] = 1;
        for(i = 1; i <= n+m; i++){
            kaijou[i] = kaijou[i-1] * i % dekai;
        }

        yabai = modinv(kaijou[n] * kaijou[m],dekai);
        ans = kaijou[n+m] * yabai % dekai;
    } 
    else{
        ans = 0;
    }

    cout << ans << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: break statement not within loop or switch
   33 |         break;
      |         ^~~~~
Language: C++

#include<iostream>
#include<vector>
#define MOD 1000000007

using namespace std;

vector<long long> fac(12500000);
vector<long long> ifac(12500000); 

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

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


int main(){
    long long x,y;
    cin>>x>>y;
    if((2*y-x)%3!=0LL){cout<<0<<endl;return 0;}
    long long r=(2*y-x)/3LL,n=r+(y-2*r);

    //cout<<n<<" "<<r<<endl;



    fac[0] = 1LL;
    ifac[0] = 1LL;
    for(long long i = 0LL; i<(12500000-10)LL; i++){
        fac[i+1] = fac[i]*(i+1) % MOD; // n!(mod M)
        ifac[i+1] = ifac[i]*mpow(i+1, MOD-2) % MOD; // k!^{M-2} (mod M) ←累乗にmpowを採用
    }

    cout<<comb(n,r)<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:43: error: expected ';' before 'LL'
   40 |     for(long long i = 0LL; i<(12500000-10)LL; i++){
      |                                           ^~
      |                                           ;
a.cc:40:43: error: 'LL' was not declared in this scope
   40 |     for(long long i = 0LL; i<(12500000-10)LL; i++){
      |                                           ^~
a.cc:40:45: error: expected ')' before ';' token
   40 |     for(long long i = 0LL; i<(12500000-10)LL; i++){
      |        ~                                    ^
      |                                             )
a.cc:40:47: error: 'i' was not declared in this scope
   40 |     for(long long i = 0LL; i<(12500000-10)LL; i++){
      |                                               ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>//sort,reverse
#include<utility>//pair
#include<queue>//queue,priority queue
#include<deque>//double_ended queue
using namespace std;
int main()
{ 
    int x0,y0;
    cin>>x0>>y0;
    if((x0+y0)%3!=0){
        cout<<0<<endl;
        return 0;
    }
    long long int x,y;
    x=x0-(x0+y0)/3;
    y=y0-(x0+y0)/3;
    //求める値はx+yCx
    //まずn!のmod10^9+7の表を作成
    long long int moad=1000000007;
    long long int fac[x+y+1];
    for(long long int i=0;i<x+y+1;i++){
        if(i==0){
            fac[0]=1;
        }
        else{
            fac[i]=fac[i-1]*i%mod;
        }
    }
    long long int inv[x+y+1];
    long long int finv[x+y+1];
    long long int a;
    //次にn!の逆元の表を作成
    for(long long int i=0;i<x+y+1;i++){
        if(i==0||i==1){
            inv[0]=1;
            inv[1]=1;
            finv[0]=1;
            finv[1]=1;
        }
        else{
            inv[i]=mod-((inv[mod%i])*(mod/i))%mod;
            finv[i]=finv[i-1]*inv[i]%mod;
        }
    }
    long long int ans=0;
    ans=(((fac[x+y]*finv[x])%mod)*finv[y])%mod;
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:31: error: 'mod' was not declared in this scope; did you mean 'moad'?
   29 |             fac[i]=fac[i-1]*i%mod;
      |                               ^~~
      |                               moad
a.cc:44:20: error: 'mod' was not declared in this scope; did you mean 'moad'?
   44 |             inv[i]=mod-((inv[mod%i])*(mod/i))%mod;
      |                    ^~~
      |                    moad
a.cc:49:30: error: 'mod' was not declared in this scope; did you mean 'moad'?
   49 |     ans=(((fac[x+y]*finv[x])%mod)*finv[y])%mod;
      |                              ^~~
      |                              moad
Language: C++

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

int recursion(int x, int y, int X, int Y) {
	if (x > X || x > Y || y > X || y > Y) return 0;
	if (x == X && y == Y) return 1;
	std::cout << x << "   " << y << "\n";
	return recursion(x + 1, y + 2, X, Y) + recursion(x + 2, y + 1, X, Y);
}


int main() {
	int X, Y;
	std::cout << "Enter X, Y: ";
	cin >> X; cin >> Y;
	long long mod = (long long)pow(10, 9) + 7;
	std::cout << recursion(0, 0, X, Y) % m;
	//system("pause");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:46: error: 'm' was not declared in this scope
   18 |         std::cout << recursion(0, 0, X, Y) % m;
      |                                              ^
Language: C

#include <stdio.h>

int X, Y;
int ng_flag = 0;

int get_pattern_num(int nowx, nowy)
{
  int tmpx, tmpy, ptn1, ptn2;
  if ( ng_flag )
    return 0;
  tmpx = X - nowx;
  tmpy = Y - nowy;
  if ( tmpx < 0 || tmpy < 0 )
    return 0;
  if ( tmpx * 2 == tmpy || tmpy * 2 == tmpx )
    return 1;
  ptn1 = get_pattern_num(nowx+1, nowy+2);
  ptn2 = get_pattern_num(nowx+2, nowy+1);
  if ( ptn1 == 0 && ptn2 == 0 )
    ng_flag = 1;
  return ptn1+ptn2;
}

int main()
{
  int r, ptn;
  r = scanf("%d %d", &X, &Y);
  ptn = get_pattern_num(0, 0);
  ptn = ptn % 1000000007;
  printf( "%d\n", ptn );
}


Compiler output:
main.c:6:31: error: unknown type name 'nowy'
    6 | int get_pattern_num(int nowx, nowy)
      |                               ^~~~
main.c: In function 'main':
main.c:28:9: error: implicit declaration of function 'get_pattern_num' [-Wimplicit-function-declaration]
   28 |   ptn = get_pattern_num(0, 0);
      |         ^~~~~~~~~~~~~~~
Language: C++

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

#define mp make_pair
#define pb push_back

#define int int64_t

const int MOD = 1e9+7;
 
mpow(int x, int y)
{
	if(y==0)
		return 1;
	int temp=mpow(x,y/2);
	if(y&1)
	{
		return (((temp*temp)%MOD)*x)%MOD;
	}
	else
		return (temp*temp)%MOD;
}


int32_t main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int x,y;
 	cin>>x>>y;
 	if(x>2*y||y>2*x)
 	{
 		cout<<0;
 		return 0;
 	}
 	if(((2*y-x)%3)||((2*x-y)%3))
 	{
 		cout<<0;
 		return 0;
 	}

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

 	int ans=1;

 	for(int i=1;i<=a+b;i++)
 	{
 		ans*=i;
 		ans%=MOD;
 	}
 	for(int i=1;i<=a;i++)
 	{
 		ans*=mpow(i,MOD-2);
 		ans%=MOD;
 	}

 	for(int i=1;i<=b;i++)
 	{
 		ans*=mpow(i,MOD-2);
 		ans%=MOD;
 	}

 	cout<<ans;

	return 0;
}

Compiler output:
a.cc:11:1: error: ISO C++ forbids declaration of 'mpow' with no type [-fpermissive]
   11 | mpow(int x, int y)
      | ^~~~
Language: C++

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

int main(){
  int x,y;
  cin >> x >> y;
  int count=0;
  for(i=1;i=1000000;i++){
    for(j=1;j=1000000;j=j+2){
      if(x==i&&y==j){
        count++;
      }
    }
  }
  for(int i=1;i=1000000;i=i+2){
    for(int j=1;j=1000000;j++){
      if(x==i&&y==j){
        count++;
      }
    }
  }
  cout << count/1000000007 <<endl;
  return 0;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=1;i=1000000;i++){
      |       ^
a.cc:9:9: error: 'j' was not declared in this scope
    9 |     for(j=1;j=1000000;j=j+2){
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define all(x) x.begin(), x.end()
const ll MOD = 1e9 + 7;
const ll MAX = 700000@;

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

void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

ll COM(int n, int 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() {
  ll x, y, numX = 0, numY;
  cin >> x >> y;
  if ((x + y) % 3 != 0)
    cout << 0 << endl;
  else {
    ll _x = x, _y = y;
    for (ll i = 0; i < x; i++) {
      if (_y * 2 == _x) {
        numY = _x / 2;
        break;
      } else {
        numX++;
        _x -= 1;
        _y -= 2;
      }
    }
    COMinit();
    cout << COM(numX + numY, numY) << endl;
  }
}

Compiler output:
a.cc:6:22: error: stray '@' in program
    6 | const ll MAX = 700000@;
      |                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
/* ちゃんと考えて実装して問題なくACできた時嬉しいよ！！ */

const ll MAX = 1000001;
const ll 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(void){
    ll x,y;
    cin >> x >> y;
    COMinit();
    if(x/2 <= y && y <= x){
        if((x+y) % 3 == 0){
            ll kk = (x+y)/3;
            ll jj = (x-k);
            cout << COM(kk, jj) << "\n";
        }
        else{
            cout << 0 << "\n";
        }
    }
    else{
        cout << 0 << "\n";
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:24: error: 'k' was not declared in this scope; did you mean 'kk'?
   38 |             ll jj = (x-k);
      |                        ^
      |                        kk
Language: C++

#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
int knight (pair<int,int>);

int main()
{
  int x, y;
    cin >> x >> y;
    pair<int,int> v(x, y);
  	cout << (knight(v) % (pow(10, 9) + 7));
  
    return 0;
}

int knight (pair<int,int> x)
{
  if ( 2*x.first > x.second && x.first < 2*x.second)
  {
    pair<int,int> temp1;
    temp1.first = x.first - 2;
    temp1.second = x.second - 1;
    pair<int,int> temp2;
    temp2.first = x.first - 1;
    temp2.second = x.second - 2;
    return knight(temp1) + knight(temp2);
  }
  else if (2*x.first == x.second || x.first == 2*x.second)
  {
    return 1;
  }
  else
  {
    return 0;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:31: error: 'pow' was not declared in this scope
   12 |         cout << (knight(v) % (pow(10, 9) + 7));
      |                               ^~~
Language: C++

#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define rep(I,N) for(auto I=0;I<(N);++I)
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
typedef long long ll;
typedef unsigned long long ull;
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                                      ins(T &p){for_each(all(p),in<decltype(p[0])>);}
template<class T>inline void                             out(T p){cout<<p<<endl;}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<endl;}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<endl;}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<endl;}
inline                                              void out(double p){printf("%.10f\n",p);}
template<class T>inline                             void outs(T p){for_each(all(p),out<decltype(p[0])>);}

cpp_int memo[1<<20][1<<20];
cpp_int rec(int x,int y){
  out(x,y);
  if(x==0&&y==0)return 1;
  if(x/y==2||y/x==2)return 1;
  if(x<0||y<0)return 0;
  cpp_int res=0;
  res+=rec(x-2,y-1);
  res+=rec(x-1,y-2);
  return memo[x][y]=res;
}
inline void solve(void){
  int X,Y;
  in(X,Y);
  out(rec(X,Y)%(1000000007));
}
int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


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

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

int main(){
  int X,Y;
  int t=0;
  int lt=0;
  cin>>X>>Y;
  int limit=1000000007;
  int C[1000010][1000010]={0}{0};
  if((X+Y)%3!=0)cout<<0<<endl;
  else{
    t=(X+Y)/3;
    lt=X-t;
    if(lt<0)cout<<0<<endl;
    for(int i=0;i<=t;i++){
      C[i][0]=1;
      C[i][0]=1;
    }
    for(int i=1;i<=t;i++){
      for(int j=1;j<=lt;j++){
        C[i][j]=(C[i-1][j-1]+C[i-1][j])%limit;
      }
    }
    cout<<C[t][lt]<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: expected ',' or ';' before '{' token
   10 |   int C[1000010][1000010]={0}{0};
      |                              ^
Language: C++

#include<iostream>

using namespace std;
long long nCr(int n, int r) {
    long ans = 1;
    for (int i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (int i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans%100000007;
}
int main(){
  long long a,b;
  cin>>a>>b;
  if((a+b)%3!=0||(double)a/b>2||(double)b/a>2){
    cout<<0<<endl;
    return 0;
  }else{
    int c=(a+b)/3;
    int d=b-a;
    int x=(c+d)/2;
    cout<<nCr(c,x)%<<endl;
    return 0;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:20: error: expected primary-expression before '<<' token
   24 |     cout<<nCr(c,x)%<<endl;
      |                    ^~
Language: C++

#include<iostream>

using namespace std;
long dp[max][max];

long long nCr(int n, int r)
{
       if(n==r) return dp[n][r] = 1;
       if(r==0) return dp[n][r] = 1;
       if(r==1) return dp[n][r] = n;
       if(dp[n][r]) return dp[n][r];
       return dp[n][r] = nCr(n-1,r) + nCr(n-1,r-1);
}
int main(){
  long long a,b;
  cin>>a>>b;
  if((a+b)%3!=0||(double)a/b>2||(double)a/b<2){
    cout<<0<<endl;
    return 0;
  }else{
    int c=(a+b)/3;
    int d=b-a;
    int x=(c+d)/2;
    cout<<nCr(c,x)<<endl;
    return 0;
  }
}


Compiler output:
a.cc:4:17: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
    4 | long dp[max][max];
      |                 ^
a.cc:4:6: error: size of array 'dp' has non-integral type '<unresolved overloaded function type>'
    4 | long dp[max][max];
      |      ^~
a.cc:4:17: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
    4 | long dp[max][max];
      |                 ^
a.cc:4:6: error: size of array 'dp' has non-integral type '<unresolved overloaded function type>'
    4 | long dp[max][max];
      |      ^~
Language: C++

#include<stdio.h>
#include<algorithm>
#include<map>
using namespace std;
int toR, toC;
unordered_map< pair<int,int>, int  > memo;
int solve(int r, int c) {
  if (toR == r && toC == c) return 1;
  if (r > toR || c > toC) return 0;
  if (memo.count(make_pair(r,c)) > 0) 
    return memo[make_pair(r,c)];
  int ans = solve(r+1,c+2);
  ans %= 1000000007;
  ans += solve(r+2,c+1);
  ans %= 1000000007;
  return memo[make_pair(r,c)] = ans;
}

int main() {
  scanf("%d%d", &toR, &toC);
  printf("%d\n", solve(0,0));
  return 0;
}


Compiler output:
a.cc:6:1: error: 'unordered_map' does not name a type
    6 | unordered_map< pair<int,int>, int  > memo;
      | ^~~~~~~~~~~~~
a.cc: In function 'int solve(int, int)':
a.cc:10:7: error: 'memo' was not declared in this scope
   10 |   if (memo.count(make_pair(r,c)) > 0)
      |       ^~~~
a.cc:16:10: error: 'memo' was not declared in this scope
   16 |   return memo[make_pair(r,c)] = ans;
      |          ^~~~
Language: C++

#include<iostream>

using namespace std;
long dp[max][max];

long long nCr(int n, int r)
{
       if(n==r) return dp[n][r] = 1;
       if(r==0) return dp[n][r] = 1;
       if(r==1) return dp[n][r] = n;
       if(dp[n][r]) return dp[n][r];
       return dp[n][r] = nCr(n-1,r) + nCr(n-1,r-1);
}
int main(){
  long long a,b;
  cin>>a>>b;
  if((a+b)%3!=0||(double)a/b>2||(double)a/b<2){
    cout<<0<<endl;
    return 0;
  }else{
    cnt =0;
    int c=(a+b)/3;
    int d=b-a;
    int x=(c+d)/2;
    cout<<nCr(n,x)<<endl;
    return 0;
  }
}


Compiler output:
a.cc:4:17: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
    4 | long dp[max][max];
      |                 ^
a.cc:4:6: error: size of array 'dp' has non-integral type '<unresolved overloaded function type>'
    4 | long dp[max][max];
      |      ^~
a.cc:4:17: error: cannot resolve overloaded function 'max' based on conversion to type 'long unsigned int'
    4 | long dp[max][max];
      |                 ^
a.cc:4:6: error: size of array 'dp' has non-integral type '<unresolved overloaded function type>'
    4 | long dp[max][max];
      |      ^~
a.cc: In function 'int main()':
a.cc:21:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
   21 |     cnt =0;
      |     ^~~
      |     int
a.cc:25:15: error: 'n' was not declared in this scope
   25 |     cout<<nCr(n,x)<<endl;
      |               ^