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

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <tuple>
#include <queue>
#include <bitset>
#include <set>
#include <map>
#include <list>

using namespace std;

const long long MOD = 1000000007;

template <typename T> class Factorial {
  public:
    vector<T> fact;
    vector<T> factinv;
    Factorial(int N);
    static T bipow(T c, T n);
    static T square(T n);
    T conv(T n, T m) const;
    T perm(T n, T m) const;
};

template <typename T> Factorial<T>::Factorial(long long N) : fact(N+1), factinv(N+1) {
  fact[0] = 1;
  for (long long i = 1; i < N+1; i++) {
    fact[i] = fact[i-1]*static_cast<T>(i)%MOD;
  }
  factinv[N] = bipow(fact[N], MOD-2);
  for (int i = N; i > 0; i--) {
    factinv[i-1] = factinv[i]*static_cast<T>(i)%MOD;
  }
}

template <typename T> T Factorial<T>::bipow(T c, T n) {
  if (n == 0) {
    return 1;
  } else if(n == 1) {
    return c;
  } else if(n%2 == 0) {
    return square(bipow(c, n/2))%MOD;
  } else {
    return (static_cast<T>(c)*square(bipow(c, (n-1)/2)))%MOD;
  }
}

template <typename T> T Factorial<T>::square(T n) {
  return static_cast<long long>(n)*n%MOD;
}

template <typename T> T Factorial<T>::conv(T n, T m) const {
  if (n < m) {
    return 0;
  }
  return (((static_cast<long long>(fact[n])*factinv[m])%MOD)*factinv[n-m])%MOD;
}

template <typename T> T Factorial<T>::perm(T n, T m) const {
  if (n < m) {
    return 0;
  }
  return (static_cast<long long>(fact[n])*factinv[n-m])%MOD;
  }

void solve(std::vector<long long> r, std::vector<long long> c){
  Factorial<long long> F(r[1]+c[1]+2LL);

  long long ret = 0;

  ret += F.conv(r[1]+c[1]+2, r[1]+1) - 1;
  ret -= F.conv(r[1]+c[0]+1, r[1]+1) - 1;
  ret %= MOD;
  ret -= F.conv(r[0]+c[1]+1, r[0]) - 1;
  ret %= MOD;
  ret += F.conv(r[0]+c[0], r[0]) - 1;
  ret %= MOD;
  std::cout << ret << std::endl;
}

int main(){
  std::vector<long long> r(2);
  std::vector<long long> c(2);
  for(int i = 0 ; i < 2 ; i++){
    scanf("%lld",&r[i]);
    scanf("%lld",&c[i]);
  }
  solve(std::move(r), std::move(c));
  return 0;
}


Compiler output:
a.cc:31:23: error: no declaration matches 'Factorial<T>::Factorial(long long int)'
   31 | template <typename T> Factorial<T>::Factorial(long long N) : fact(N+1), factinv(N+1) {
      |                       ^~~~~~~~~~~~
a.cc:24:5: note: candidate is: 'Factorial<T>::Factorial(int)'
   24 |     Factorial(int N);
      |     ^~~~~~~~~
a.cc:20:29: note: 'class Factorial<T>' defined here
   20 | template <typename T> class Factorial {
      |                             ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<string> vst;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;


const ll mod=1e9+7;
const ll inf=1e16; 

#define rep(i,m,n) for(ll i=m;i<n;i++)
#define repr(i,m,n) for(ll i=m;i>=n;i--)

const long nmax=2000005;

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

void comint(){
 fac[0]=fac[1]=1;
 finv[0]=finv[1]=1;
 inv[1]=1;
 for(long i=2;i<nmax;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;
}
}

auto com(auto n, auto k){
 if(n<k||n<0||k<0) return 0;
 return fac[n]*(finv[k]*finv[n-k]%mod)%mod;
}

int main(){
   cin.tie(nullptr);
  ios::sync_with_stdio(false);
  
  ll r1,c1,r2,c2;
  cin >> r1 >> c1 >> r2 >> c2;
  ll res=0;
  comint();
  
  rep(y,c1,c2+1) {
    ll num=com(r2+y+1,y+1)-com(r1+y,y+1);
    (num+mod)%=mod;
    res+=num;
    res%=mod;
  }
   cout << res << endl;
}


Compiler output:
a.cc:35:10: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   35 | auto com(auto n, auto k){
      |          ^~~~
a.cc:35:18: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   35 | auto com(auto n, auto k){
      |                  ^~~~
a.cc: In instantiation of 'auto com(auto:28, auto:29) [with auto:28 = long long int; auto:29 = long long int]':
a.cc:50:15:   required from here
   50 |     ll num=com(r2+y+1,y+1)-com(r1+y,y+1);
      |            ~~~^~~~~~~~~~~~
a.cc:37:39: error: inconsistent deduction for auto return type: 'int' and then 'long long int'
   37 |  return fac[n]*(finv[k]*finv[n-k]%mod)%mod;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
a.cc: In function 'int main()':
a.cc:51:9: error: lvalue required as left operand of assignment
   51 |     (num+mod)%=mod;
      |     ~~~~^~~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define all(v) (v).begin(), (v).end()
#define io ios::sync_with_stdio(0)
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define rson rt << 1 | 1, mid + 1, r
#define lson rt << 1, l, mid
#define lll __int128
#define pii pair<int, int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define int long long
const int mod = 1e9 + 7;
inline int ksm(int a, int b)
{
	int ans = 1;
	for (; b; b >>= 1, a = a * a % mod)
		if (b & 1)
			ans = ans * a % mod;
	return ans;
}
struct nd{
	int l,r;
	int d;
	int v;
};
int fac[300000],inv[300000];
int C(int n,int m){
	if(n<0 || m>n)return 0;
	return fac[n]*inv[m]%mod*inv[n-m]%mod;
}
nd cal(nd t,int d,int l,int r){
	//nd res = t;
	if(r-l+1<=4){
		rep(i,t.l,t.r)t.v =(t.v-C(t.d,i))%mod;
		t.d=d;
		t.l=l;t.r=r;
		rep(i,l,r)t.v =(t.v+ C(t.d,i))%mod;
	}
	else {
		t.v=(2*t.v%mod-C(t.d,t.l)-C(t.d,t.r))%mod;
		t.v=(t.v+C(d,t.l))%mod;
		if(t.l<l)t.v=(t.v-C(d,t.l))%mod;
		if(t.r<r)t.v=(t.v+C(d,r))%mod;
		t.d=d;t.l=l;t.r=r;
	}
	return t;
}


int gao(int n,int m){
	if(n>m)swap(n,m);
	//cout<<n<<" "<<m<<endl;
	int ans=0;
	nd t;t.d=t.l=t.r=0;t.v=1;
	rep(i,0,m+n){
		int l=max(i-m,0ll),r=min(i,n);
		t = cal(t,i,l,r);
		ans =(ans+t.v)%mod;
	//	cout<<t.d<<" "<<t.v<<" "<<t.l<<" "<<t.r<<endl;
	}
	return ans;
}
signed main()
{
	fac[0]=inv[0]=1;
	rep(i,1,3e6-1){
		fac[i]=fac[i-1]*i%mod;
		inv[i] = ksm(fac[i],mod-2);
	}
	//cout<<C(0,0);
	/*
{	nd t;
	t.d = t.l = t.r = 0;
	t.v = 1;
	rep(i,1,20){
		t=cal(t,i,0,i);
		cout<<t.v<<endl;
	}
}
*/
	int r1,r2,c1,c2;
	cin>>r1>>c1>>r2>>c2;
	int t=gao(r2,c2) - gao(r1-1,c2) - gao(r2,c1-1) + gao(c1-1,r1-1);
	t=(t%mod+mod)%mod;
	cout<<t<<endl;h
	getchar();getchar();
}


Compiler output:
a.cc: In function 'int main()':
a.cc:88:23: error: 'h' was not declared in this scope
   88 |         cout<<t<<endl;h
      |                       ^
Language: C++

//todo: compare with tle
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007
ll arr[2000050];
ll g(int x,int y)
ll f(int x,int y)
ll cal(ll a,int b)
int main(){  
	int r1, r2, c1, c2;  
	arr[0]=1;
	for (int i=1;i<2000010;i++) arr[i]=(arr[i-1]*(ll)i)%MOD;
	cin>>r1>>c1>>r2>>c2;
	ll ans=g(r2,c2)-g(r1-1,c2)-g(r2,c1-1)+g(r1-1,c1-1);
	ans%=MOD;
	if (ans<0) ans+=MOD;
	cout<<ans;
	return 0;
}

ll g(int x,int y) {
	ll sum=0;
	for (int i=1;i<=x+1;i++) 
		(sum+=f(i,y))%=MOD;
	return sum;
}

ll f(int x,int y) {
	return arr[x+y]*cal(arr[x],MOD-2)%MOD*cal(arr[y],MOD-2)%MOD;
}

ll cal(ll a,int b) {
	if (b==0) return 1;
	if (b%2==1) return a*cal(a*a%MOD,b/2)%MOD;
	else return cal(a*a%MOD,b/2); 
}


Compiler output:
a.cc:4:12: error: expected initializer before 'long'
    4 | #define ll long long
      |            ^~~~
a.cc:8:1: note: in expansion of macro 'll'
    8 | ll f(int x,int y)
      | ^~
a.cc: In function 'long long int g(int, int)':
a.cc:25:23: error: 'f' was not declared in this scope
   25 |                 (sum+=f(i,y))%=MOD;
      |                       ^
a.cc: In function 'long long int f(int, int)':
a.cc:30:25: error: 'cal' was not declared in this scope
   30 |         return arr[x+y]*cal(arr[x],MOD-2)%MOD*cal(arr[y],MOD-2)%MOD;
      |                         ^~~
Language: C++

//todo: compare with tle
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007

ll arr[2000050];

int main(){  
	int r1, r2, c1, c2;  
	arr[0]=1;
	for (int i=1;i<2000010;i++) arr[i]=(arr[i-1]*(ll)i)%MOD;
	cin>>r1>>c1>>r2>>c2;
	ll ans=g(r2,c2)-g(r1-1,c2)-g(r2,c1-1)+g(r1-1,c1-1);
	ans%=MOD;
	if (ans<0) ans+=MOD;
	cout<<ans;
	return 0;
}

ll g(int x,int y) {
	ll sum=0;
	for (int i=1;i<=x+1;i++) 
		(sum+=f(i,y))%=MOD;
	return sum;
}

ll f(int x,int y) {
	return arr[x+y]*cal(arr[x],MOD-2)%MOD*cal(arr[y],MOD-2)%MOD;
}

ll cal(ll a,int b) {
	if (b==0) return 1;
	if (b%2==1) return a*cal(a*a%MOD,b/2)%MOD;
	else return cal(a*a%MOD,b/2); 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'g' was not declared in this scope
   14 |         ll ans=g(r2,c2)-g(r1-1,c2)-g(r2,c1-1)+g(r1-1,c1-1);
      |                ^
a.cc: In function 'long long int g(int, int)':
a.cc:24:23: error: 'f' was not declared in this scope
   24 |                 (sum+=f(i,y))%=MOD;
      |                       ^
a.cc: In function 'long long int f(int, int)':
a.cc:29:25: error: 'cal' was not declared in this scope
   29 |         return arr[x+y]*cal(arr[x],MOD-2)%MOD*cal(arr[y],MOD-2)%MOD;
      |                         ^~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
ll r1, r2, c1, c2, ans, arr[2000020];
ll g(int, int);
ll f(ll, ll);
ll cal(ll, int);
int main()
{
	ios::sync_with_stdio(false);
	arr[0] = 1;
	for(int i = 1; i<=2000010; ++i) arr[i] = arr[i-1]*(ll)i%MOD;
    cin>>r1>>c1>>r2>>c2;
	ans = g(r2, c2)-g(r1-1, c2)-g(r2, c1-1)+g(r1-1, c1-1);
	ans = (ans+MOD)%MOD;
	cout<<ans<<"\n";
}

ll g(int a, int b)
{
	ll sum = 0;
	for(ll i = 1; i<=a+1; ++i) 
		//sum+=f(i, b)%MOD;
		(sum+=f(i, b))%=MOD;
	return sum;
}

ll f(int a, int b)
{
	//(a+b)!/a!/b!;
	return arr[a+b]*cal(arr[a], MOD-2)%MOD*cal(arr[b], MOD-2)%MOD;
}

ll cal(ll a, int b)
{
	if(b==0) return 1;
	if(b%2) return a*cal(a*a%MOD, b/2)%MOD;
	return cal(a*a%MOD, b/2)%MOD;
}

Compiler output:
/usr/bin/ld: /tmp/ccMF06e6.o: in function `g(int, int)':
a.cc:(.text+0x22c): undefined reference to `f(long long, long long)'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
ll r1, r2, c1, c2, ans, arr[2000020];
ll g(int, int);
ll f(ll, ll);
ll cal(ll, int);
int main()
{
	ios::sync_with_stdio(false);
	arr[0] = 1;
	for(int i = 1; i<=2000010; ++i) arr[i] = arr[i-1]*(ll)i%MOD;
    cin>>r1>>c1>>r2>>c2;
	ans = g(r2, c2)-g(r1-1, c2)-g(r2, c1-1)+g(r1-1, c1-1);
	ans = (ans+MOD)%MOD;
	cout<<ans<<"\n";
}

ll g(ll a, ll b)
{
	ll sum = 0;
	for(ll i = 1; i<=a+1; ++i) 
		//sum+=f(i, b)%MOD;
		(sum+=f(i, b))%=MOD;
	return sum;
}

ll f(int a, int b)
{
	//(a+b)!/a!/b!;
	return arr[a+b]*cal(arr[a], MOD-2)%MOD*cal(arr[b], MOD-2)%MOD;
}

ll cal(ll a, int b)
{
	if(b==0) return 1;
	if(b%2) return a*cal(a*a%MOD, b/2)%MOD;
	return cal(a*a%MOD, b/2)%MOD;
}

Compiler output:
/usr/bin/ld: /tmp/ccuztcR3.o: in function `main':
a.cc:(.text+0x110): undefined reference to `g(int, int)'
/usr/bin/ld: a.cc:(.text+0x12f): undefined reference to `g(int, int)'
/usr/bin/ld: a.cc:(.text+0x14e): undefined reference to `g(int, int)'
/usr/bin/ld: a.cc:(.text+0x170): undefined reference to `g(int, int)'
/usr/bin/ld: /tmp/ccuztcR3.o: in function `g(long long, long long)':
a.cc:(.text+0x22c): undefined reference to `f(long long, long long)'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
ll r1, r2, c1, c2, ans, arr[2000020];
ll g(ll, ll);
ll f(ll, ll);
ll cal(ll, ll);
int main()
{
	ios::sync_with_stdio(false);
	arr[0] = 1;
	for(int i = 1; i<=2000010; ++i) arr[i] = arr[i-1]*(ll)i%MOD;
    cin>>r1>>c1>>r2>>c2;
	ans = g(r2, c2)-g(r1-1, c2)-g(r2, c1-1)+g(r1-1, c1-1);
	ans = (ans+MOD)%MOD;
	cout<<ans<<"\n";
}

ll g(ll a, ll b)
{
	ll sum = 0;
	for(ll i = 1; i<=a+1; ++i) 
		//sum+=f(i, b)%MOD;
		(sum++f(i, b))%=MOD;
	return sum;
}

ll f(ll a, ll b)
{
	//(a+b)!/a!/b!;
	return arr[a+b]*cal(arr[a], MOD-2)%MOD*cal(arr[b], MOD-2)%MOD;
}

ll cal(ll a, ll b)
{
	if(b==0) return 1;
	if(b%2) return a*cal(a*a%MOD, b/2)%MOD;
	return cal(a*a%MOD, b/2)%MOD;
}

Compiler output:
a.cc: In function 'long long int g(long long int, long long int)':
a.cc:25:23: error: expected ')' before 'f'
   25 |                 (sum++f(i, b))%=MOD;
      |                 ~     ^
      |                       )
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringJoiner;
import java.util.StringTokenizer;
import java.util.function.IntUnaryOperator;
import java.util.function.LongUnaryOperator;

class Main {
    static In in = new In();
    static Out out = new Out();
    static long mod = 1000000007;
    static long inf = 0xfffffffffffffffL;

    void solve() {
        int r1 = in.nextInt();
        int c1 = in.nextInt();
        int r2 = in.nextInt();
        int c2 = in.nextInt();
        out.println((f(r2 + 1, c2 + 1) - f(r2 + 1, c1) - f(r1, c2 + 1) + f(r1, c1) + mod) % mod);
    }

    long f(int r, int c) {
        long a = 0;
        for (int i = 1; i < r; i++) {
            a = (a + AtCoderUtils.combinationAndMod(c + i, i + 1) - 1) % mod;
        }
        return a;
    }

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

class In {
    private BufferedReader reader = new BufferedReader(new InputStreamReader(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;
    }
}

class Out {
    private static PrintWriter out = new PrintWriter(System.out);

    void println(Object... a) {
        StringJoiner joiner = new StringJoiner(" ");
        for (Object obj : a) {
            joiner.add(String.valueOf(obj));
        }
        out.println(joiner);
    }

    void flush() {
        out.flush();
    }
}


Compiler output:
Main.java:27: error: cannot find symbol
            a = (a + AtCoderUtils.combinationAndMod(c + i, i + 1) - 1) % mod;
                     ^
  symbol:   variable AtCoderUtils
  location: class Main
1 error
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#define ALL(x) (x).begin(), (x).end()
#define sz(a) int(a.size())
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define chu(x) cout<<"["<<#x<<" "<<(x)<<"]"<<endl
#define du3(a,b,c) scanf("%d %d %d",&(a),&(b),&(c))
#define du2(a,b) scanf("%d %d",&(a),&(b))
#define du1(a) scanf("%d",&(a));
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;}
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
ll powmod(ll a, ll b, ll MOD) { if (a == 0ll) {return 0ll;} a %= MOD; ll ans = 1; while (b) {if (b & 1) {ans = ans * a % MOD;} a = a * a % MOD; b >>= 1;} return ans;}
void Pv(const vector<int> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%d", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
void Pvl(const vector<ll> &V) {int Len = sz(V); for (int i = 0; i < Len; ++i) {printf("%lld", V[i] ); if (i != Len - 1) {printf(" ");} else {printf("\n");}}}
inline long long readll() {long long tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') fh = -1; c = getchar();} while (c >= '0' && c <= '9') tmp = tmp * 10 + c - 48, c = getchar(); return tmp * fh;}
inline int readint() {int tmp = 0, fh = 1; char c = getchar(); while (c < '0' || c > '9') {if (c == '-') fh = -1; c = getchar();} while (c >= '0' && c <= '9') tmp = tmp * 10 + c - 48, c = getchar(); return tmp * fh;}
const int maxn = 1000010;
const int inf = 0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
const ll mod = 1e9 + 7;
ll getpc(ll m, ll n) //m 中 选 n 个
{
    long long ans = 1;
    ll base = powmod(k, mod - 2ll, mod);
    for (long long k = 1; k <= n; k++)
    {
        ans = (ans * (m - n + k)) % mod *  base % mod;
        // ans %= mod;
    }
    return ans;
}
ll gao(ll n, ll m)
{
    return (getpc(n + m , m) - 1ll + mod) % mod;
}
int main()
{
    //freopen("D:\\code\\text\\input.txt","r",stdin);
    //freopen("D:\\code\\text\\output.txt","w",stdout);
    ll r1, c1, r2, c2;
    cin >> r1 >> c1 >> r2 >> c2;
    r1++;
    c1++;
    r2++;
    c2++;
    ll ans = gao(r2, c2);
    // chu(ans);
    ans = (ans - gao(r1 - 1, c2) + mod) % mod;
    // chu(ans);
    ans = (ans - gao(r2, c1 - 1) + mod) % mod;
    // chu(ans);
    ans = (ans + gao(r1 - 1, c1 - 1)) % mod;
    printf("%lld\n", ans );
    return 0;
}




Compiler output:
a.cc: In function 'll getpc(ll, ll)':
a.cc:46:22: error: 'k' was not declared in this scope
   46 |     ll base = powmod(k, mod - 2ll, mod);
      |                      ^
Language: C++

#F
from operator import mul
from functools import reduce

r1, c1, r2, c2 = [int(i) for i in input().split()]
mod = 10**9 + 7

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

def f(rr,cc):
    #(0,0)~(r,c)までのコンビネーションの累積和
    #print(rr+cc+2, cc+1)
    #print(combinations_count(rr+cc+2, cc+1))
    return combinations_count(rr+cc+2, cc+1) - 1

ans = f(r2, c2) - f(r2, c1-1) - f(r1-1, c2) + f(r1-1, c1-1)
print(ans % mod)

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #F
    1 | #F
      |  ^
a.cc:15:6: error: invalid preprocessing directive #(
   15 |     #(0,0)~(r,c)までのコンビネーションの累積和
      |      ^
a.cc:16:6: error: invalid preprocessing directive #print
   16 |     #print(rr+cc+2, cc+1)
      |      ^~~~~
a.cc:17:6: error: invalid preprocessing directive #print
   17 |     #print(combinations_count(rr+cc+2, cc+1))
      |      ^~~~~
a.cc:2:1: error: 'from' does not name a type
    2 | from operator import mul
      | ^~~~
Language: C++

#include <iostream>
#include <cmath>
#define F 1000000007
#define MAX 100000

int map[2*MAX][MAX]={0};
int pick(long long int,long long int);
int main(void){
  long long int r1,c1,r2,c2;
  std::cin >> r1 >> c1 >> r2 >> c2;
  long long int i,j;
  long long int sum = 0;
  for(i=0;i<=r2-r1;i++){
    for(j=0;j<=c2-c1;j++){
      sum = (sum + pick(r1+i,c1+j))%F;
    }
  }
  std::cout << sum << std::endl;
  return 0;
}

int pick(long long int m,long long int n){
  //値が入っている
  if(map[m][n] != 0){
    return map[m][n]
  }
  //mCn = mCn-n
  if(map[m][m-n] != 0){
    return map[m][m-n];
  }
  //まだ値が入っていない
  map[m][n] = (pick(m-1,n-1) + pick(m-1,n))%F;
  return map[m][n];
}

Compiler output:
a.cc: In function 'int pick(long long int, long long int)':
a.cc:25:21: error: expected ';' before '}' token
   25 |     return map[m][n]
      |                     ^
      |                     ;
   26 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define MOD 1000000007
#define MAXN 2000200

vector<ll> primes;

void mount_sieve(vector<bool>& sieve) {
	sieve[0] = sieve[1] = false;
	for (ll i = 2; i < MAXN; i++) {
		if (sieve[i]) {
			primes.push_back(i);
			ll x = i * i;
			while (x < MAXN) {
				sieve[x] = false;
				x += i;
			}
		}
	}
}

ll mod_pow(ll num, ll pot) {
	if (pot == 0) return 1;
	if (pot % 2 == 0) {
		ll x = mod_pow(num, pot / 2);
		x *= x;
		x %= MOD;
		return x;
	} else {
		ll x = mod_pow(num, pot - 1);
		x *= num;
		x %= MOD;
		return x;
	}
}

ll calc(ll a, ll b) {
	vector<int> factors(primes.size(), 0);
	ll target = a + b;
	for (int i = 0; i < primes.size(); i++) {
		ll prime = primes[i];
		while (prime <= target) {
			factors[i] += target / prime;
			prime *= primes[i];
		}
	}
	target = a;
	for (int i = 0; i < primes.size(); i++) {
		ll prime = primes[i];
		while (prime <= target) {
			factors[i] -= target / prime;
			prime *= primes[i];
		}
	}
	target = b;
	for (int i = 0; i < primes.size(); i++) {
		ll prime = primes[i];
		while (prime <= target) {
			factors[i] -= target / prime;
			prime *= primes[i];
		}
	}
	ll ret = 1;
	for (int i = 0; i < (int)factors.size(); i++) {
		ret *= mod_pow(primes[i], factors[i]);
		ret %= MOD;
	}
	return ret;
}

int main() {
	ios::sync_with_stdio(false);
	vector<bool> sieve(MAXN, true);
	mount_sieve(sieve);
	int r1, c1, r2, c2;
	cin >> r1 >> c1 >> r2 >> c2;
	ll a = calc(r2 + 1, c2 + 1);
	ll b = calc(r1, c1);a
	ll c = calc(r2+1, c1);
	ll d = calc(r1, c2+1);
	ll ans = (a + b) % MOD - (c + d) % MOD;
	ans += MOD;
	ans %= MOD;
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:82:30: error: expected ';' before 'll'
   82 |         ll b = calc(r1, c1);a
      |                              ^
      |                              ;
   83 |         ll c = calc(r2+1, c1);
      |         ~~                    
a.cc:85:35: error: 'c' was not declared in this scope
   85 |         ll ans = (a + b) % MOD - (c + d) % MOD;
      |                                   ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int a,b,c,d;
  cin >> a >> c >> b >> d;
  int sum;
  for(int i = a; i <= b; i++)
  {
    for(int j = c; j <= d; j++)
    {
      sum += fac(i+j) / (fac(i) * fac(j));
      if(sum >= 1000000007)
      {
        sum = sum - 1000000007;
      }
    }
  }

  cout << sum;
  return 0;
}

int fac(int i)
{
  int f;
  for(int i = 1; i <= f; i++)
  {
    f *= i;
  }
  return f;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'fac' was not declared in this scope
   12 |       sum += fac(i+j) / (fac(i) * fac(j));
      |              ^~~
Language: C++

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

#define MOD 1000000007
#define MOD_DEFAULT MOD
ll _mpow(ll b, ll x, ll m) {
    if (x == 0) return 1;
    if (x & 1) return _mpow(b * b % m, x / 2, m) * b % m;
    return _mpow(b * b % m, x / 2, m);
}
inline ll mpow(ll b, ll x, ll m=MOD_DEFAULT) { return _mpow(b % m, x, m); }

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

    int r1, c1, r2, c2;
    cin >> r1 >> c1 >> r2 >> c2;

    vll fact(r2+c2+1);
    vll finv(r2+c2+1);
    vll inv(r2+c2+1);
    
    fact[0] = fact[1] = 1;
    finv[0] = finv[1] = 1;
    inv[0] = 0; [1] = 1;
    for (int i = 2; i < fact.size(); i++) {
        fact[i] = fact[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }

    vll f(c2-c1+1);
    // f[0] = fact[r1+c1] * mpow(fact[r1], MOD-2, MOD) % MOD
    //                     * mpow(fact[c1], MOD-2, MOD) % MOD;
    f[0] = fact[r1+c1] * finv[r1] % MOD * finv[c1] % MOD;
    ll ans = f[0];

    rep1(i, c2-c1+1) {
        // f[i] = f[i-1] * (r1+c1+i) % MOD
        //               * mpow(c1 + i, MOD-2, MOD) % MOD;
        f[i]  = f[i-1] * (r1+c1+i) % MOD * inv[c1 + i] % MOD;
        //f[i] = fact[r1+c1+i] * finv[r1] % MOD * finv[c1+i] % MOD;
        ans = (ans + f[i]) % MOD;
    }
    rep1(i, r2-r1+1) {
        // f[0] = f[0] * (r1+c1+i) % MOD
        //                     * mpow(r1 + i, MOD-2, MOD) % MOD;
        f[0] = f[0] * (r1+c1+i) % MOD * inv[r1 + i] % MOD;
        ans = (ans + f[0]) % MOD;
        rep1(j, c2-c1+1) {
            f[j] = (f[j] + f[j-1]) % MOD;
            ans = (ans + f[j]) % MOD;
        }
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:18: error: expected identifier before numeric constant
   30 |     inv[0] = 0; [1] = 1;
      |                  ^
a.cc: In lambda function:
a.cc:30:21: error: expected '{' before '=' token
   30 |     inv[0] = 0; [1] = 1;
      |                     ^
a.cc: In function 'int main()':
a.cc:30:23: error: no match for 'operator=' (operand types are 'main()::<lambda()>' and 'int')
   30 |     inv[0] = 0; [1] = 1;
      |                       ^
a.cc:30:19: note: candidate: 'main()::<lambda()>& main()::<lambda()>::operator=(const main()::<lambda()>&)' (deleted)
   30 |     inv[0] = 0; [1] = 1;
      |                   ^
a.cc:30:19: note:   no known conversion for argument 1 from 'int' to 'const main()::<lambda()>&'
Language: C++

MOD = 10**9+7
r1,c1,r2,c2 = map(int,input().split())

size = 1010000*2
f_list = [1]*(size)
for i in range(1,size):
    f_list[i] = (f_list[i-1]*i)%MOD

def func(r,c):
    return (f_list[r+c]*pow(f_list[r],MOD-2,MOD)*pow(f_list[c],MOD-2,MOD))

ans = func(r2+1,c2+1)-1
ans += func(r1,c1)-1
ans -= func(r2+1,c1)-1
ans -= func(r1,c2+1)-1
print(ans%MOD)



Compiler output:
a.cc:1:1: error: 'MOD' does not name a type
    1 | MOD = 10**9+7
      | ^~~
Language: C++

#include <iostream>
using namespace std;
#define ll long long

const int mod = 1e9+7, maxn = 2000010;
int r1, c1, r2, c2;

ll pre[maxn];
ll inv[maxn];
ll prei[maxn];
void build(int n){
    pre[1] = pre[0] = 1, inv[1] = inv[0] = 1, prei[1] = prei[0] = 1;
    for(int i = 2 ; i <= n ; i++){
        pre[i] = pre[i-1] * i % mod;
        inv[i] = (mod - mod / i * inv[mod % i] % mod) % mod;
        prei[i] = prei[i-1] * inv[i] % mod;
    }
}
ll C(int n, int k){
   return pre[n] * prei[k] % mod * prei[n-k] % mod;
}

ll solve(int x, int y){
    for (x == 0 || y == 0) return 0;
    ll ret = 0;
    for (int i = 1; i <= y; i++){
        ret += c(x+i+1, i+1);
    }
    ret -= y;
    return ret % mod;
}

int main(){
    build(2000005);
    cin >> r1 >> c1 >> r2 >> c2;
    cout << (solve(r2, c2)-solve(r1-1, c2)-solve(r2, c1-1)+solve(r1-1, c1-1)+mod*2)%mod << "\n";
}


Compiler output:
a.cc: In function 'long long int solve(int, int)':
a.cc:24:26: error: expected ';' before ')' token
   24 |     for (x == 0 || y == 0) return 0;
      |                          ^
      |                          ;
a.cc:26:5: error: expected primary-expression before 'for'
   26 |     for (int i = 1; i <= y; i++){
      |     ^~~
a.cc:25:16: error: expected ')' before 'for'
   25 |     ll ret = 0;
      |                ^
      |                )
   26 |     for (int i = 1; i <= y; i++){
      |     ~~~         
a.cc:24:9: note: to match this '('
   24 |     for (x == 0 || y == 0) return 0;
      |         ^
a.cc:27:16: error: 'c' was not declared in this scope
   27 |         ret += c(x+i+1, i+1);
      |                ^
a.cc:29:5: error: 'ret' was not declared in this scope
   29 |     ret -= y;
      |     ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int r1,r2,c1,c2;
const int maxN=1e6,M=1e9+7;
ll iv[3*maxN],f1[3*maxN],f2[3*maxN];
 
ll nck(int n,int k){
  return f1[n]*f2[k]%M*f2[n-k]%M;
}
 
int main(){
  iv[1]=1;
  for(int i=2;i<3*maxN;i++)
    	inv[i]=M-M/i*inv[M%i]%M;
  f1[0]=f2[0]=1;
  for(int i=1;i<3*maxN;i++){
    f1[i]=f1[i-1]*i%M;
    f2[i]=f2[i-1]*iv[i]%M;
  }
  cin>>r1>>c1>>r2>>c2; 
  cout<<((nck(r2+c2+2,c2+1)-nck(r1+c2+1,c2+1)-nck(r2+c1+1,c1)+nck(r1+c1,c1)%M+M)%M);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'inv' was not declared in this scope; did you mean 'iv'?
   15 |         inv[i]=M-M/i*inv[M%i]%M;
      |         ^~~
      |         iv
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int r1,r2,c1,c2;
const int maxN=1e6,M=1e9+7;
ll iv[3*maxN],f1[3*maxN],f2[3*maxN];
 
ll nck(int n,int k){
  return f1[n]*f2[k]%M*f2[n-k]%M;
}
 
int main(){
  inv[1]=1;
  for(int i=2;i<3*maxN;i++)
    	inv[i]=M-M/i*inv[M%i]%M;
  f1[0]=f2[0]=1;
  for(int i=1;i<3*maxN;i++){
    f1[i]=f1[i-1]*i%M;
    f2[i]=f2[i-1]*iv[i]%M;
  }
  cin>>r1>>c1>>r2>>c2; 
  cout<<((nck(r2+c2+2,c2+1)-nck(r1+c2+1,c2+1)-nck(r2+c1+1,c1)+nck(r1+c1,c1)%M+M)%M);
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int r1,r2,c1,c2;
const int maxN=1e6,M=1e9+7;
ll inv[3*maxN],f1[3*maxN],f2[3*maxN];

ll nck(int n,int k){
  return f1[n]*f2[k]%M*f2[n-k]%M;
}

int main(){
  inv[1]=1;
  for(int i=2;i<3*maxN;i++)
    	inv[i]=M-M/i*inv[M%i]%M;
  f1[0]=f2[0]=1;
  for(int i=1;i<3*maxN;i++){
    f1[i]=f1[i-1]*i%M;
    f2[i]=f2[i-1]*iv[i]%M;
  }
  cin>>r1>>c1>>r2>>c2; 
  cout<<(nck(r2+c2+2,c2+1)-nck(r1+c2+1,c2+1)-nck(r2+c1+1,c1)+nck(r1+c1,c1)%M+M)%M);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: 'iv' was not declared in this scope; did you mean 'i'?
   19 |     f2[i]=f2[i-1]*iv[i]%M;
      |                   ^~
      |                   i
a.cc:22:82: error: expected ';' before ')' token
   22 |   cout<<(nck(r2+c2+2,c2+1)-nck(r1+c2+1,c2+1)-nck(r2+c1+1,c1)+nck(r1+c1,c1)%M+M)%M);
      |                                                                                  ^
      |                                                                                  ;
Language: C++

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

const int MAX = 2000005;
const int mod = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = mod - inv[mod%i] * (mod / i) % mod;
        finv[i] = finv[i - 1] * inv[i] % mod;
    }
}
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

int main(){

COMinit();
 int i,j;
 int r1;
 int r2;
 int c1;
 int c2;
 long long int ans = 0;
 cin >> r1 >> c1 >> r2 >> c2;
 for(i=r1;i<=r2;i++){
         ans += COM(i+c2+1,i)-COM(i+c1,i);
         ans %= mod;
 }}
cout << ans << endl;
}

Compiler output:
a.cc:38:1: error: 'cout' does not name a type
   38 | cout << ans << endl;
      | ^~~~
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

//  Created by conan1024hao in 2020.
//  Copyright © 2020 conan1024hao. All rights reserved.
//  専用ライブラリです、自由にコピーして構いません。
//  感谢看我的代码！Wechat:conan1024hao Twitter/QQ:810396815
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 10e8
#define INF 10e16
#define MOD 1000000007
#define mod 1000000007
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
//using Int=int_fast64_t;
typedef long long int ll;
typedef long long int LL;
typedef pair<ll,ll>Pll;
typedef pair<int,int>Pin;
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }
long long LCM(long long a, long long b)  {return a/GCD(a,b)*b;}
int dx[8]={-1,0,1,0,1,1,-1,-1};
int dy[8]={0,-1,0,1,1,-1,1,-1};
char dir[4]={'u','l','d','r'};
ll cmp1(pair<ll,string>a,pair<ll,string> b){
        if(a.fi!=b.fi)
        return a.fi<b.fi;
        else
        return a.se<b.se;
}

//---------------------------------------------------------------------------
const int MAX = 3100000;

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

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算
long long COM(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(){//問題をちゃんと見ろ!!!!!!!!!!!!!!!!!      llか??????????统一类型        memset()!!!!!!!!!!!!       ペナを減らせ!!!!!!!!!!!!!
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    COMinit();
    ll r1,r2,c1,c2;cin>>r1>>c1>>r2>>c2;
    ll ans=0;
    for(ll i=r1;i<=r2;i++){
        ans+==COM(i+1+c2,i+1)%MOD-COM(i+c1,i+1)%MOD;
        ans%=MOD;
    }
    cout<<ans<<endl;
    //-------------------------------
    return 0;
}
//---------------------------------------------------------------------------








Compiler output:
a.cc: In function 'int main()':
a.cc:96:14: error: expected primary-expression before '=' token
   96 |         ans+==COM(i+1+c2,i+1)%MOD-COM(i+c1,i+1)%MOD;
      |              ^
Language: Java

import java.util.Scanner;

public class MOD {
    private static final long MOD = 1_000_000_007L;
    private static int TARGET = 2000002;
    private static long[] mod = new long[TARGET];

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        initmod();
        int r1,r2,c1,c2;
        r1=sc.nextInt();
        c1=sc.nextInt();
        r2=sc.nextInt();
        c2=sc.nextInt();
        assert(com(5,2) % MOD == 10);
        assert(com(4,2) % MOD == 6);
        long res;
        res = calc(r2, c2) - calc(r1-1, c2) - calc(r2, c1-1) + calc(r1-1, c1-1);
        res += MOD;
        res %= MOD;
        System.out.println(res);

    }

    private static long calc(int r, int c){
        if(r < 0 || c < 0){
            return 0;
        }
        long sum = 0;
        for(int i=1;i<=r+1;i++){
            sum += com(i+c, c);
            sum %= MOD;
        }
        return sum;
    }



    private static long com(int n, int k){
        long res = mod[n] * modinv(mod[n-k]) % MOD;
        res *= modinv(mod[k]);
        res %= MOD;
        return res;
    }


    private static void initmod(){
        mod[0]=1;
        mod[1]=1;
        for(int i=2;i<TARGET;i++){
            mod[i] = (mod[i-1] * i) % MOD;
        }
    }

    private static long modpow(long n, long k){
        if(k==0){
            return 1;
        }
        if(k==1){
            return n % MOD;
        }
        long res = modpow( n , k/2);
        res = (res * res) % MOD;
        if(k % 2 == 1){
            return (res * n) % MOD;
        }else{
            return res;
        }
    }


    public static long modinv(long n){
        return modpow(n, MOD-2);
    }
}


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

#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<bitset>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0;i < (n);i++)
#define repr(i, n) for(int i = (n);i >= 0;i--)
#define repf(i, m, n) for(int i = (m);i < (n);i++)

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1;} return 0;}
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
//////////////////////////////////////////////////

const ll mod = 1e9+7;

// combination c;
// c(n, k); => nCk
struct combination {
    const int max = 10000000;
    vector<long long> fact, ifact, inv;
    combination() {
        fact.resize(max);   // i!
        ifact.resize(max);  // (i!)^(mod-2)
        inv.resize(max);    // i^(mod-2)
        fact[0] = fact[1] = 1;
        ifact[0] = ifact[1] = 1;
        inv[1] = 1;
        for (int i = 2; i < max; i++) {
            fact[i] = fact[i-1] * i % mod;
            inv[i] = mod - inv[mod%i] * (mod/i) % mod;
            ifact[i] = ifact[i-1] * inv[i] % mod;
        }
    }

    long long operator()(int n, int k) {
        if (n < k) return 0;
        if (k < 0 || k > n) return 0;
        return fact[n]*ifact[k]%mod*ifact[n-k]%mod;
    }
};

int main() {
    int r1,c1,r2,c2;
    cin >> r1 >> c1 >> r2 >> c2;
    combination c;

    ll s1, s2, s3, s4;
    // ans = s1 - s3 - s4 + s2
    s1 = c(c2+r2+2,c2+1);
    s2 = c(c1+r1,c1);
    s3 = c(c1+r2+1, c1);
    s4 = c(c2+r1+1, c2+1);
    ll ans = s1 + s2 - s3 - s4;
    ans %= mod;
    ans += mod;
    ans %= mod
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:15: error: expected ';' before 'cout'
   64 |     ans %= mod
      |               ^
      |               ;
   65 |     cout << ans << endl;
      |     ~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> P;

// http://drken1215.hatenablog.com/entry/2018/06/08/210000

const int MAX = 2123456;
const int MOD = 1000000007;

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

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

long long COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

long long sum(int x, int y)
{
    if ((long long)x * y == 0)
        return 0;
    ll res = 0;
    for (int i = 1; i <= y; i++)
    {
        res += COM(i + 1 + x, x);
        res += MOD - COM(i, 0);
        res %= MOD;
    }
    return res;
}

int main()
{
    COMinit();

    int r1, r2, c1, c2;
    cin >> r1 >> c1 >> r2 >> c2;

    long long res = sum(r2, c2);
    res += MOD - sum(r1 - 1, c2);
    res += MOD - sum(r2, c1 - 1);
    res += sum(r1 - 1, c1 - 1);
    res %= MOD;

    cout << res << endl;

    return 0;
}


Compiler output:
a.cc: In function 'long long int sum(int, int)':
a.cc:40:5: error: 'll' was not declared in this scope
   40 |     ll res = 0;
      |     ^~
a.cc:43:9: error: 'res' was not declared in this scope
   43 |         res += COM(i + 1 + x, x);
      |         ^~~
a.cc:47:12: error: 'res' was not declared in this scope
   47 |     return res;
      |            ^~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef pair<int, int> P;

// http://drken1215.hatenablog.com/entry/2018/06/08/210000

const int MAX = 2123456;
const int MOD = 1e7;

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

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

long long COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll sum(int x, int y)
{
    if ((long long)x * y == 0)
        return 0;
    long long res = 0;
    for (int i = 1; i <= y; i++)
    {
        res += COM(i + 1 + x, x);
        res += MOD - COM(i, 0);
        res %= MOD;
    }
    return res;
}

int main()
{


    COMinit();

    int r1, r2, c1, c2;
    cin >> r1 >> c1 >> r2 >> c2;

    long long res = sum(r2, c2);
    res += MOD - sum(r1 - 1, c2);
    res += MOD - sum(r2, c1 - 1);
    res += sum(r1 - 1, c1 - 1);
    res %= MOD;

    cout << res << endl;

    return 0;
}


Compiler output:
a.cc:36:1: error: 'll' does not name a type
   36 | ll sum(int x, int y)
      | ^~
a.cc: In function 'int main()':
a.cc:59:21: error: 'sum' was not declared in this scope
   59 |     long long res = sum(r2, c2);
      |                     ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define repp(i, m, n) for(int i = m, i##_len = (n); i < i##_len; ++i)
#define reprev(i, n) for(int i = (n-1LL); i >= 0; --i)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

constexpr int MOD = 1000000007;

// + - * / ^
int mod(int a)
{
    int res = a % MOD;
    if(res < 0) {
        return res + MOD;
    }
    return res;
}
int mul_mod(int a, int b)
{
    ll res = ((ll)a * (ll)b) % MOD;
    return mod((int)res);
}
int pow_mod(int a, int b)
{
    ll res = 1;
    while (b > 0) {
        if(b & 1) {
            res = res * (ll)a % (ll)MOD;
        }
        a = mul_mod(a, a);
        b >>= 1;
    }
    return (int)res;
}
int inv_mod(int a)
{
    return pow_mod(a, MOD - 2);
}
int div_mod(int a, int b)
{
    return mul_mod(a, inv_mod(b));
}

// ! C
constexpr int FAC_MAX = 3000000;
ll fac[FAC_MAX], finv[FAC_MAX], inv[FAC_MAX];
void com_init()
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < FAC_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_mod(int a, int b){
    if (a < b) return 0;
    if (a < 0 || b < 0) return 0;
    return fac[a] * (finv[b] * finv[a - b] % MOD) % MOD;
}


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    com_init();
    int r1, r2, c1, c2;
    cin >> r1 >> c1 >> r2 >> c2;
    int ans = 0;
    repp (i, c1, c2 + 1) {
        ans = mod(ans + com_mod(r2 + i + 1, i + 1));
        ans = mod(ans - com_mod(r1 + i, i + 1));
    }
    cout << ans << '\n';
    return 0;
}y

Compiler output:
a.cc:116:2: error: 'y' does not name a type
  116 | }y
      |  ^
Language: C++

#include <iostream>
#include <algorithm>

constexpr long long MOD = 1e9 + 7;
constexpr int MAX = 1000001;
constexpr long long fac[MAX], finv[MAX], inv[MAX];

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

constexpr long long com(int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    cominit();
	long long r1, r2, c1, c2;
	std::cin >> r1 >> c1 >> r2 >> c2;
    long long sum = 0LL;
	for (int i = r1; i <= r2; i++) {
        for (int j = c1; j <= c2; j++) {
            sum += com(i + j, j);
        }
        sum %= MOD;
	}
    std::cout << sum << std::endl;
	return 0;
}


Compiler output:
a.cc:6:21: error: uninitialized 'const fac' [-fpermissive]
    6 | constexpr long long fac[MAX], finv[MAX], inv[MAX];
      |                     ^~~
a.cc:6:31: error: uninitialized 'const finv' [-fpermissive]
    6 | constexpr long long fac[MAX], finv[MAX], inv[MAX];
      |                               ^~~~
a.cc:6:42: error: uninitialized 'const inv' [-fpermissive]
    6 | constexpr long long fac[MAX], finv[MAX], inv[MAX];
      |                                          ^~~
a.cc: In function 'constexpr void cominit()':
a.cc:9:21: error: assignment of read-only location 'fac[1]'
    9 |     fac[0] = fac[1] = 1;
      |              ~~~~~~~^~~
a.cc:10:23: error: assignment of read-only location 'finv[1]'
   10 |     finv[0] = finv[1] = 1;
      |               ~~~~~~~~^~~
a.cc:11:12: error: assignment of read-only location 'inv[1]'
   11 |     inv[1] = 1;
      |     ~~~~~~~^~~
a.cc:13:16: error: assignment of read-only location 'fac[i]'
   13 |         fac[i] = fac[i - 1] * i % MOD;
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:14:16: error: assignment of read-only location 'inv[i]'
   14 |         inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:15:17: error: assignment of read-only location 'finv[i]'
   15 |         finv[i] = finv[i - 1] * inv[i] % MOD;
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#define p 1000000007
using namespace std;
long long a[1000000][1000000];
int main()
{
	int b[4];cin>>b[0]>>b[1]>>b[2]>>b[3];long long sum=0;
	sort(b,b+4);
	a[0][0]=1;
	for(int i=0;i<=b[3];++i)
	{
		for(int j=0;j<=b[3];++j)
		a[i][j]=(f[i-1][j]+f[i][j-1])%p;
	}
	for(int i=0;i<4;++i)
	{if(b[i]!b[i+1])
	{for(int j=0;j<4;++j)
		{
			if(b[j]!=b[j+1])
			sum+=a[b[i]][b[j]]%p;
		}	
	}
		
	}cout<<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: 'f' was not declared in this scope
   14 |                 a[i][j]=(f[i-1][j]+f[i][j-1])%p;
      |                          ^
a.cc:17:17: error: expected ')' before '!' token
   17 |         {if(b[i]!b[i+1])
      |            ~    ^
      |                 )
Language: C++

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

const int MAX = 2000000;
const int MOD = 1000000007;

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

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

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

int main(){
    // 前処理
    COMinit();
    int r1,c1,r2,c2;
    cin>>r1>>c1>>r2>>c2;
    ll ans=0;
    ans=(ans+COM(r1+c1,r1))%MOD;
    ll a=0;
    rep(i,r2-r1){
      a=(a+COM(r1+c1+i+1,r1))%MOD;
      ans=(ans+a*(r2-r1+1))%MOD;
    }
    ll a=0;
    rep(i,c2-c1){
      a=(a+COM(r1+c1+i+1,c1))%MOD;
      ans=(ans+a*(c2-c1+1))%MOD;
    }
    cout <<ans<< endl;
    return 0;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:43:8: error: redeclaration of 'll a'
   43 |     ll a=0;
      |        ^
a.cc:38:8: note: 'll a' previously declared here
   38 |     ll a=0;
      |        ^