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

#include <bits/stdc++.h>
using namespace std;
struct node
{
  int w, s;
  long long v;
}a[1007];
 
bool cmp(node &x, node &y) 
{
  return x.w + x.s < y.w + y.s;
}

int main()
{
    int n;
  	cin >> n;
  	long long dp[n];
    for (int i = 1; i <= n; i++)
    {
      cin>>a[i].w;
      cin>>a[i].s;
      cin>>a[i].v;
    }
    sort(a + 1, a + 1 + n, cmp);
    long long result = 0;
    for (int i = 1; i <= n; i++)
        for (int j = a[i].s + a[i].w; j >= a[i].w; j--)
            result = result(ans, dp[j] = max(dp[j], dp[j - a[i].w] + a[i].v));
  cout<<result;  
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:29: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |             result = result(ans, dp[j] = max(dp[j], dp[j - a[i].w] + a[i].v));
      |                             ^~~
      |                             abs
a.cc:29:28: error: 'result' cannot be used as a function
   29 |             result = result(ans, dp[j] = max(dp[j], dp[j - a[i].w] + a[i].v));
      |                      ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
long long dp[20007];
 
struct node
{
  int w, s;
  ll v;
}a[1007];
 
bool cmp(node &x, node &y) 
{
  return x.w + x.s < y.w + y.s;
}

int main()
{
    int n;
  	cin >> n;
    for (int i = 1; i <= n; i++)
    {
      cin>>a[i].w;
      cin>>a[i].s;
      cin>>a[i].v;
    }
    sort(a + 1, a + 1 + n, cmp);
    ll ans = 0;
    for (int i = 1; i <= n; i++)
        for (int j = a[i].s + a[i].w; j >= a[i].w; j--)
            ans = max(ans, dp[j] = max(dp[j], dp[j - a[i].w] + a[i].v));
  cout<<ans;  
    return 0;
}

Compiler output:
a.cc:9:3: error: 'll' does not name a type
    9 |   ll v;
      |   ^~
a.cc: In function 'int main()':
a.cc:25:17: error: 'struct node' has no member named 'v'
   25 |       cin>>a[i].v;
      |                 ^
a.cc:28:5: error: 'll' was not declared in this scope
   28 |     ll ans = 0;
      |     ^~
a.cc:31:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |             ans = max(ans, dp[j] = max(dp[j], dp[j - a[i].w] + a[i].v));
      |             ^~~
      |             abs
a.cc:31:69: error: 'struct node' has no member named 'v'
   31 |             ans = max(ans, dp[j] = max(dp[j], dp[j - a[i].w] + a[i].v));
      |                                                                     ^
a.cc:32:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |   cout<<ans;
      |         ^~~
      |         abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pii;
typedef pair<pii,ll> piii;
typedef pair<ll,pii> ipii;
#define MOD 1000000007
#define mod(a) ((a)%MOD)
#define pb push_back
#define ft first
#define sd second
#define mp make_pair
#define dbg(x) cerr<<#x<<" = "<<x<<"\n"
#define dbg2(x,y) cerr<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<"\n"
#define dbg3(x,y,z) cerr<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<" , "<<#z<<" = "<<z<<"\n"
#define INF (1LL<<60)
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;*/
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define endl '\n'
ll gcd(ll a,ll b){if(a==0) return b; return gcd(b%a,a);}
ll powm(ll base,ll exp,ll mod=MOD) {base%=mod;ll ans=1;while(exp){if(exp&1LL) ans=(ans*base)%mod;exp>>=1LL,base=(base*base)%mod;}return ans;}
 



vector<ipii> p;
ll dp[10003][20004];

bool comp(ipii a,ipii b){
     return (a.ft+a.sd.ft)<(b.ft+b.sd.ft);
}


int main(){
      sync;
      ll n;
      cin>>n;
      f=0;
      for(int i=0;i<n;i++){
            ll w,s,v;
            cin>>w>>s>>v;
            if(s>10000){
                  f=1;
            }
            p.pb({s,{w,v}});
      }
        if(f==1){

            while(1){
                  int b;
                  int a=2*b;
            }
        }
        sort(all(p),comp);
        ll ans=0;
        for(int i=0;i<=20000;i++){
               dp[0][i]=(p[0].sd.ft<=i?p[0].sd.sd:0);
        }
        for(int i=1;i<n;i++){
             for(int j=0;j<=20000;j++){
                  if(j==0){
                       dp[i][j]=0;continue;
                  }
                  dp[i][j]=dp[i-1][j];
                  if(p[i].sd.ft<=j){
                        dp[i][j]=max(dp[i][j],dp[i-1][min(j-p[i].sd.ft,p[i].ft)]+p[i].sd.sd);
                  }
             }
        }

        for(int i=0;i<=20000;i++) ans=max(ans,dp[n-1][i]);
        cout<<ans<<endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:7: error: 'f' was not declared in this scope
   43 |       f=0;
      |       ^
Language: C++

#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long   ll;
typedef unsigned long long   ull;
typedef long double ld;
typedef pair<ll, ll>    pll;
typedef pair<ull, ull>    pull;
typedef pair<ll, ll>  pii;
typedef pair<ld, ld>  pld;
struct tower{
    ll w, s, v;
};
ll n;
tower a[1009];
ll dp[1009][20003];
ll ans;
ll sfunc(tower a, tower b){
    return a.s-b.w > b.s-a.w;
}
ll main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    
    cin >> n;
    for(ll i = 0; i < n; ++i)
        cin >> a[i].w >> a[i].s >> a[i].v;
    sort(a, a+n, sfunc);
    dp[0][a[0].s] = a[0].v;
    for(ll i = 1; i < n; ++i){
        dp[i][a[i].s] = a[i].v;
        for(ll j = 0; j < 10003; ++j){
            if(j >= a[i].w){
                dp[i][min(a[i].s, j-a[i].w)] =
                max(dp[i][min(a[i].s, j-a[i].w)], dp[i-1][j]+a[i].v); 
                ans = max(ans, dp[i][min(a[i].s, j-a[i].w)]);
            }
            dp[i][j] = max(dp[i][j], dp[i-1][j]);
        }
    }
    cout << ans << "\n";
}

Compiler output:
a.cc:24:1: error: '::main' must return 'int'
   24 | ll main() {
      | ^~
Language: Java

import afu.org.checkerframework.checker.igj.qual.I;

import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;

public class Main {

    static long mod = (long) (1e9 + 7);

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        int n = in.nextInt();
        int[] wa = new int[n];
        int[] sa = new int[n];
        long[] va = new long[n];
        List<Item> items = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            wa[i] = in.nextInt();
            sa[i] = in.nextInt();
            va[i] = in.nextInt();
            items.add(new Item(wa[i], sa[i], va[i]));
        }
        Collections.sort(items);
        int wsum = 20500;
        long[] dp = new long[wsum + 1];

        for (int i = 0; i < n; i++) {
            Item itm = items.get(i);
            for (int j = Math.min(itm.s, wsum - itm.w); j >= 0; j--) {
                dp[j + itm.w] = Math.max(dp[j + itm.w], itm.val + dp[j]);
            }
        }
        long ans = 0;
        for (int i = 0; i < wsum; i++) {
            ans = Math.max(ans, dp[i]);
        }
        out.println(ans);
        out.close();
    }

    static class Item implements Comparable<Item> {
        int w;
        int s;
        long val;

        public Item(int w, int s, long val) {
            this.w = w;
            this.s = s;
            this.val = val;
        }

        @Override
        public int compareTo(Item o) {
            if ((w + s) == (o.s + o.w)) {
                return (w - o.w);
            } else {
                return Integer.compare((w + s), (o.s + o.w));
            }
        }
    }


    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

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

        public double nextDouble() {
            return Double.parseDouble(next());
        }

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

    }
}

Compiler output:
Main.java:1: error: package afu.org.checkerframework.checker.igj.qual does not exist
import afu.org.checkerframework.checker.igj.qual.I;
                                                ^
1 error
Language: Java

import afu.org.checkerframework.checker.igj.qual.I;

import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;

public class Main2 {

    static long mod = (long) (1e9 + 7);

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        int n = in.nextInt();
        int[] wa = new int[n];
        int[] sa = new int[n];
        long[] va = new long[n];
        List<Item> items = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            wa[i] = in.nextInt();
            sa[i] = in.nextInt();
            va[i] = in.nextInt();
            items.add(new Item(wa[i], sa[i], va[i]));
        }
        Collections.sort(items);
        int wsum = 20500;
        long[] dp = new long[wsum + 1];

        for (int i = 0; i < n; i++) {
            Item itm = items.get(i);
            for (int j = Math.min(itm.s, wsum - itm.w); j >= 0; j--) {
                dp[j + itm.w] = Math.max(dp[j + itm.w], itm.val + dp[j]);
            }
        }
        long ans = 0;
        for (int i = 0; i < wsum; i++) {
            ans = Math.max(ans, dp[i]);
        }
        out.println(ans);
        out.close();
    }

    static class Item implements Comparable<Item> {
        int w;
        int s;
        long val;

        public Item(int w, int s, long val) {
            this.w = w;
            this.s = s;
            this.val = val;
        }

        @Override
        public int compareTo(Item o) {
            if ((w + s) == (o.s + o.w)) {
                return (w - o.w);
            } else {
                return Integer.compare((w + s), (o.s + o.w));
            }
        }
    }


    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

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

        public double nextDouble() {
            return Double.parseDouble(next());
        }

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

    }
}

Compiler output:
Main.java:9: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
Main.java:1: error: package afu.org.checkerframework.checker.igj.qual does not exist
import afu.org.checkerframework.checker.igj.qual.I;
                                                ^
2 errors
Language: C++

#include <vector>
#include <iostream>
#include <unordered_map>
#include <algorithm>
using namespace std;
class row {
public:
	int weight;
	int solid;
	int value;
};
class tower
{
private:
	unordered_map<int, unsigned long long> max_value_of_solid;
	void display();
	int n;
	unsigned long long retval;
	vector<row*> rows;
	void build_up(vector<bool>& choices, int solid, unsigned long long value);
	void set_retval();
public:
	tower();
};


tower::tower() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		int w,s,v;
		cin >> w;
		cin >> s;
		cin >> v;
		row* r = new row();
		r->weight = w;
		r->solid = s;
		r->value = v;
		rows.push_back(r);
	}
	vector<bool> current_choices;
	current_choices.resize(n, false);
	build_up(current_choices, -1, 0);
	set_retval();
	display();
}
void tower::display() {
	cout << retval;
}
void tower::set_retval() {
	retval = 0;
	for (auto& s : max_value_of_solid) {
		if (s.second > retval) {
			retval = s.second;
		}
	}
}
void tower::build_up(vector<bool>& choices, int solid, unsigned long long value) {
	if (max_value_of_solid.find(solid) != max_value_of_solid.end() && max_value_of_solid[solid] > value) {
		// we cant do any better from current config
		return;
	}
	else if (solid == 0) {
		//tower is full
		if (max_value_of_solid.find(0) == max_value_of_solid.end() || value > max_value_of_solid[0]) {
			max_value_of_solid[0] = value;
		}
	}
	else if (solid == -1) {
	//tower is empty
		for (int i = 0; i < n; i++) {
			choices[i] = true;
			row* r = rows[i];
			int new_solid = r->solid;
			unsigned long long new_value = r->value;
			if (max_value_of_solid.find(new_solid) == max_value_of_solid.end() || max_value_of_solid[new_solid] < new_value) {
				max_value_of_solid[new_solid] = new_value;
				build_up(choices, new_solid, new_value);
			}
			choices[i] = false;
	}
	}
	else {
		for (int i = 0; i < n; i++) {
			if (!choices[i]) {
				choices[i] = true;
				row* r = rows[i];
				int new_solid = min(r->solid, solid - r->weight);
				if (new_solid >= 0) {
					unsigned long long new_value = value + r->value;
					if (max_value_of_solid.find(new_solid) == max_value_of_solid.end() || max_value_of_solid[new_solid] <= new_value) {
						max_value_of_solid[new_solid] = new_value;
						build_up(choices, new_solid, new_value);
					}
				}
				choices[i] = false;
			}
	}
	}
}

int main(){
  tower* x = new tower();
  return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:103:11: error: expected ';' before '}' token
  103 |   return 0
      |           ^
      |           ;
  104 | }
      | ~
Language: C++

#pragma once
#include <vector>
#include <iostream>
#include <unordered_map>
#include <algorithm>
using namespace std;
class row {
public:
	int weight;
	int solid;
	int value;
};
class tower
{
private:
	unordered_map<int, unsigned long long> max_value_of_solid;
	void display();
	int n;
	unsigned long long retval;
	vector<row*> rows;
	void build_up(vector<bool>& choices, int solid, unsigned long long value);
	void set_retval();
public:
	tower();
};


tower::tower() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		int w,s,v;
		cin >> w;
		cin >> s;
		cin >> v;
		row* r = new row();
		r->weight = w;
		r->solid = s;
		r->value = v;
		rows.push_back(r);
	}
	vector<bool> current_choices;
	current_choices.resize(n, false);
	build_up(current_choices, -1, 0);
	set_retval();
	display();
}
void tower::display() {
	cout << retval;
}
void tower::set_retval() {
	retval = 0;
	for (auto& s : max_value_of_solid) {
		if (s.second > retval) {
			retval = s.second;
		}
	}
}
void tower::build_up(vector<bool>& choices, int solid, unsigned long long value) {
	if (max_value_of_solid.find(solid) != max_value_of_solid.end() && max_value_of_solid[solid] > value) {
		// we cant do any better from current config
		return;
	}
	else if (solid == 0) {
		//tower is full
		if (max_value_of_solid.find(0) == max_value_of_solid.end() || value > max_value_of_solid[0]) {
			max_value_of_solid[0] = value;
		}
	}
	else if (solid == -1) {
	//tower is empty
		for (int i = 0; i < n; i++) {
			choices[i] = true;
			row* r = rows[i];
			int new_solid = r->solid;
			unsigned long long new_value = r->value;
			if (max_value_of_solid.find(new_solid) == max_value_of_solid.end() || max_value_of_solid[new_solid] < new_value) {
				max_value_of_solid[new_solid] = new_value;
				build_up(choices, new_solid, new_value);
			}
			choices[i] = false;
	}
	}
	else {
		for (int i = 0; i < n; i++) {
			if (!choices[i]) {
				choices[i] = true;
				row* r = rows[i];
				int new_solid = min(r->solid, solid - r->weight);
				if (new_solid >= 0) {
					unsigned long long new_value = value + r->value;
					if (max_value_of_solid.find(new_solid) == max_value_of_solid.end() || max_value_of_solid[new_solid] <= new_value) {
						max_value_of_solid[new_solid] = new_value;
						build_up(choices, new_solid, new_value);
					}
				}
				choices[i] = false;
			}
	}
	}
}

int main(){
  tower* x = new tower();
  return 0
}

Compiler output:
a.cc:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
a.cc: In function 'int main()':
a.cc:104:11: error: expected ';' before '}' token
  104 |   return 0
      |           ^
      |           ;
  105 | }
      | ~
Language: C++

#if 1

#include <bits/stdc++.h>
using namespace std;
int n;
long long d[20005];

struct XY
{
    int w,s,v;
}a[1005];

bool cmp(XY x,XY y)
{
    return x.w+x.s < y.w+y.s;
}

int main()
{
    scanf("%d",&n);
    for(int i = 1;i <= n;i++)
    {
        scanf("%d %d %d", &a[i].w, &a[i].s, &a[i].v);
    }
    sort(a+1,a+n+1,cmp);
    long long ans = 0;
    for(int i = 1;i <= n;i++)
    {
        for(int j = 20005.s;j >= 0;j--)
      //	for(int j=0; j<20005; j++)
        {
            d[j+a[i].w] = max(d[j+a[i].w],d[j]+a[i].v);

        }
        //for(int j = 0;j <= 30;j++) cout << d[j] << " ";
        //cout << '\n';
    }
    for(int i = 0;i <= 20004;i++)
    {
        //cout << d[i] << " ";
        ans = max(ans,d[i]);
    }
    printf("%lld",ans);
}

#endif // 1


Compiler output:
a.cc: In function 'int main()':
a.cc:29:21: error: cannot convert 'std::chrono::duration<long double>' to 'int' in initialization
   29 |         for(int j = 20005.s;j >= 0;j--)
      |                     ^~~~~~~
      |                     |
      |                     std::chrono::duration<long double>
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cassert>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <queue>
#define PIE 3.14159265358979
#define MAX_N 16
#define rep(i,n) for(int i = 0;i < (n);i++)
#define show(x) cout<<(#x)<<":"<<x<<" ";
#define showl(x) cout<<(#x)<<":"<<x<<endl;

using namespace std;
typedef long long ll;
const ll MAX_DP 10005;

int main(){
    int N;
    int w[1005],s[1005];
    ll v[1005];
    ll dp[MAX_DP];
    vector<pair<int,int> > vec;//w+s,index
    
    cin>>N;
    vec.reserve(N);
    rep(i,MAX_DP){dp[i]=-1;}
    dp[0]=0;
    rep(i,N){
        cin>>w[i]>>s[i]>>v[i];
        vec.push_back(make_pair(w[i]+s[i],i));
    }
    sort(vec.begin(),vec.end());
    for(auto iter:vec){
        int i = iter.second;
        for(int j = s[i];j>=0;j--){
            if(dp[j]>=0&&j+w[i]<MAX_DP){
                dp[j+w[i]]=max(dp[j+w[i]],dp[j]+v[i]);
            }
        }
    }
    ll ans = 0;
    rep(i,MAX_DP){ans = max(dp[i],ans);}
    cout<<ans<<endl;
}


Compiler output:
a.cc:19:17: error: expected initializer before numeric constant
   19 | const ll MAX_DP 10005;
      |                 ^~~~~
a.cc: In function 'int main()':
a.cc:25:11: error: 'MAX_DP' was not declared in this scope; did you mean 'MAX_N'?
   25 |     ll dp[MAX_DP];
      |           ^~~~~~
      |           MAX_N
a.cc:30:19: error: 'dp' was not declared in this scope
   30 |     rep(i,MAX_DP){dp[i]=-1;}
      |                   ^~
a.cc:31:5: error: 'dp' was not declared in this scope
   31 |     dp[0]=0;
      |     ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct inp{
	int w,s;
	long long v;
	inline bool operator <(const inp &a) const{
		return min(s-a.w,a.s)>min(a.s-w,s);
	}
}a[1005];
long long dp[1005][10005];
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		scanf("%d %d %lld",&a[i].w,&a[i].s,&a[i].v);
	}
	sort(a,a+n);
	for(int i=0;i<n;i++){
		for(int j=1;j<n;j++){
			dp[i][j]=-1e18;
		}
	}
	long long ma=0;
	dp[0][a[0].s]=a[0].v;
	ma=max(a[0].v);
	for(int i=1;i<n;i++){
		for(int j=0;j<=10000;j++) dp[i][j]=dp[i-1][j];
		dp[i][a[i].s]=max(dp[i][a[i].s],a[i].v);
		for(int j=a[i].w;j<=10000;j++){
			dp[i][min(a[i].s,j-a[i].w)]=max(dp[i][min(a[i].s,j-a[i].w)],dp[i-1][j]+a[i].v);
		}
		for(int j=0;j<=10000;j++) ma=max(ma,dp[i][j]);
	}
	cout<<ma;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: no matching function for call to 'max(long long int&)'
   25 |         ma=max(a[0].v);
      |            ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
a.cc:25:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   25 |         ma=max(a[0].v);
      |            ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct inp{
	int w,s;
	long long v;
	inline bool operator <(const inp &a) const{
		return a.s+a.w>b.s+b.w;
	}
}a[1005];
long long dp[1005][10005];
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		scanf("%d %d %lld",&a[i].w,&a[i].s,&a[i].v);
	}
	sort(a,a+n);
	for(int i=0;i<n;i++){
		for(int j=1;j<n;j++){
			dp[i][j]=-1e18;
		}
	}
	dp[0][a[0].s]=a[0].v;
	long long ma=0;
	for(int i=1;i<n;i++){
		for(int j=0;j<=10000;j++) dp[i][j]=dp[i-1][j];
		for(int j=a[i].w;j<=10000;j++){
			dp[i][min(a[i].s,j-a[i].w)]=max(dp[i][min(a[i].s,j-a[i].w)],dp[i-1][j]+a[i].v);
		}
		for(int j=0;j<=10000;j++) ma=max(ma,dp[i][j]);
	}
	cout<<ma;
	
}

Compiler output:
a.cc: In member function 'bool inp::operator<(const inp&) const':
a.cc:7:32: error: 'b' was not declared in this scope
    7 |                 return a.s+a.w>b.s+b.w;
      |                                ^
Language: C++

#include<map>
#include<set>
#include<bitset>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<chrono>
#include<stack>
#include<fstream>
#include<list>
#define REP(i,x,y) for(ll i=x;i<=y;i++)
#define SIZE(a) ll(a.size())
#define vll vector<ll> 
#define MEMSET(a, n, m) for(ll i=0;i<=n;i++) a[i] = m
#define BIT(n) (ll(1)<<n)
#define UNIQUE(v) v.erase(unique(v.begin(),v.end()),v.end()) 
#define UNIQUE_ARRAY(a,x) unique(a + 1, a + x + 1) - a - 1
#define SORT(a,n) sort(a+1,a+n+1)
#define SORT_O(a,n,order) sort(a+1,a+n+1,order)
#define PER(i,y,x) for(ll i=y;i>=x;i--)
typedef long long ll;
using namespace std;


struct edge
{
	long long to; long long len;
	bool operator<(const edge& rhs) const {
		return len > rhs.len;
	}
};

ll const MAX = 2e4 + 4;
ll w[MAX], s[MAX], v[MAX];
ll dp[MAX][MAX] = {};
ll upper[MAX];
bool order(ll x, ll y) {
	return w[x] + s[x] < w[y] + s[y];
}

ll s_max = 0; ll w_max = 0;

int main(){
	ll n; cin >> n;
	REP(i, 1, n) {
		cin >> w[i] >> s[i] >> v[i];
		upper[i] = i;
		s_max = max(s_max, s[i]);
		w_max = max(w_max, w[i]);
	}
	SORT_O(upper, n, order);
	REP(j, 1, s_max + w_max) {
		dp[0][j] = -1e18;
	}
	REP(i, 1, n) {
		ll cur = upper[i];
		REP(j, 0, s_max + w_max) {
			if (j < w[cur] || j - w[cur] > s[cur]) {
				dp[i][j] = dp[i - 1][j];
			}
			else {
				dp[i][j] = max( dp[i - 1][j], dp[i - 1][j - w[cur]] + v[cur] );
			}
		}
	}
	ll ans = 0;
	REP(j, 0, s_max + w_max) {
		ans = max(ans, dp[n][j]);
	}
	cout << ans << endl;
	REP(i, 1, n) {
		cout << upper[i] << " ";
	}cout << endl;
	REP(i, 0, n) {
		REP(j, 0, s_max + w_max) {
			cout << dp[i][j] << " ";
		}
		cout << endl << endl;
	}
	
}

Compiler output:
/tmp/ccGBdXkB.o: in function `main':
a.cc:(.text+0x121): relocation truncated to fit: R_X86_64_PC32 against symbol `upper' defined in .bss section in /tmp/ccGBdXkB.o
a.cc:(.text+0x149): relocation truncated to fit: R_X86_64_PC32 against symbol `s_max' defined in .bss section in /tmp/ccGBdXkB.o
a.cc:(.text+0x15b): relocation truncated to fit: R_X86_64_PC32 against symbol `s_max' defined in .bss section in /tmp/ccGBdXkB.o
a.cc:(.text+0x17b): relocation truncated to fit: R_X86_64_PC32 against symbol `w_max' defined in .bss section in /tmp/ccGBdXkB.o
a.cc:(.text+0x18d): relocation truncated to fit: R_X86_64_PC32 against symbol `w_max' defined in .bss section in /tmp/ccGBdXkB.o
a.cc:(.text+0x1b7): relocation truncated to fit: R_X86_64_PC32 against symbol `upper' defined in .bss section in /tmp/ccGBdXkB.o
a.cc:(.text+0x1c2): relocation truncated to fit: R_X86_64_PC32 against symbol `upper' defined in .bss section in /tmp/ccGBdXkB.o
a.cc:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `s_max' defined in .bss section in /tmp/ccGBdXkB.o
a.cc:(.text+0x212): relocation truncated to fit: R_X86_64_PC32 against symbol `w_max' defined in .bss section in /tmp/ccGBdXkB.o
a.cc:(.text+0x23b): relocation truncated to fit: R_X86_64_PC32 against symbol `upper' defined in .bss section in /tmp/ccGBdXkB.o
a.cc:(.text+0x3c9): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.StringTokenizer;

public class Test5 {
	
	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		
		int H = Integer.parseInt(st.nextToken()); int W = Integer.parseInt(st.nextToken());
		int N = Integer.parseInt(st.nextToken());
		
		long[][] dp = new long[H+1][W+1];
		boolean[][] wall = new boolean[H+1][W+1];
		
		for(int i=0; i<N; i++) {
			st = new StringTokenizer(br.readLine());
			wall[Integer.parseInt(st.nextToken())][Integer.parseInt(st.nextToken())] = true;
		}
		for(int i=1; i<=H; i++) {
			for(int j=1; j<=W; j++) {
				if(wall[i][j]) {
					dp[i][j] = 0;
					continue;
				}
				if(i==1 || j==1) {
					dp[i][j] = 1;
				}else {
					dp[i][j] = dp[i-1][j] + dp[i][j-1];
				}
			}
		}
		System.out.println(dp[H][W]);
		
	}
}

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

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

int mo=1000000007;
int fct[300000];
int mi[200005];
int modInverse(int a, int m) 
{ 
    int m0 = m; 
    int y = 0, x = 1; 
  
    if (m == 1) 
      return 0; 
  
    while (a > 1) 
    { 
        // q is quotient 
        int q = a / m; 
        int t = m; 
  
        // m is remainder now, process same as 
        // Euclid's algo 
        m = a % m, a = t; 
        t = y; 
  
        // Update y and x 
        y = x - q * y; 
        x = t; 
    } 
  
    // Make x positive 
    if (x < 0) 
       x += m0; 
  
    return x; 
}

int do(int c)
{
    for(int i=0;i<=c;i++)
        mi[i]=modInverse(fct[i]);
}
int slv(int x,int y)
{
    int ans=1;
    ans=(fct[x+y]*ans)%mo;
    ans=(ans*mi[x])%mo;
    ans=(ans*mi[y])%mo;
    return ans;
}
int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,h,w;
    cin>>h>>w>>n;
    fct[0]=1;
    for(int i=1;i<=w+h+5;i++)
        fct[i]=(fct[i-1]*i)%mo;
    int ans=slv(h-1,w-1);
    int dp[n+5];
    memset(dp,0,sizeof(dp));
    pair<int,int> a[n+5];
    for(int i=0;i<n;i++)
        cin>>a[i].first>>a[i].second;
    a[n].first=a[n].second=1;
    sort(a,a+n+1);
    dp[0]=1;
    //cout<<ans<<" \n";
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<i;j++)
            if(a[j].first<=a[i].first && a[j].second <=a[i].second)
                dp[i]=(dp[i] - (dp[j] * slv(a[i].first - a[j].first,a[i].second - a[j].second))%mo + mo)%mo;
        ans = (ans +(dp[i] * slv(h - a[i].first  , w - a[i].second ))%mo +mo)%mo;
    }
    cout<<ans;
}


Compiler output:
a.cc:39:5: error: expected unqualified-id before 'do'
   39 | int do(int c)
      |     ^~
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
int main()
{
  ll m,n;
  cin>>m>>n;
  ll dp[m+1][n+1];
  memset(dp,-1,sizeof(dp));
  for(ll i=0;i<m+1;++i){dp[i][0]=0;}
  for(ll i=0;i<n+1;++i){dp[0][i]=1;}
  ll q,a,b;cin>>q;
  while(q--){
    cin>>a>>b;
    dp[a][b]=0;
  }
  for(ll i=1;i<m+1;++i){
    for(ll j=1;j<n+1;++j){
      if(dp[i][j]!=0){
        dp[i][j]=(dp[i-1][j]%mod + dp[i][j-1]%mod)%mod;
      }
    }
  }
  cout<<dp[m][n];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>m>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:24:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   24 |   cout<<dp[m][n];
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.Scanner;

class Main {
    private static int R;
    private static int C;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        R = sc.nextInt();
        C = sc.nextInt();

        char[][] arr = new char[R + 1][C + 1];
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int r = sc.nextInt();
            int c = sc.nextInt();
            arr[r][c] = 1;
        }
        
        int[][] dp = new int[R + 1][C + 1];
        
        for(int i = 1; i<= R; i++) {
          for(int j = 1; j <= C; j++) {
            
            if(i == 1 && j == 1) {
               dp[i][j] = 1;
            } else if(i == 1) {
              dp[i][j] = arr[i][j] == 1 ? 0 : dp[i][j - 1];
            } else if(j == 1) {
              dp[i][j] = arr[i][j] == 1 ? 0 : dp[i - 1][j];
            } else {
              if(arr[i][j] == 1) {
                dp[i][j] = 0;
              } else {
                dp[i][j] = Math.min(dp[i][j - 1], dp[i - 1][j]) + 1;
              }
          }
        }
          
        int answer = dp[R][C] % 1000000007;
          System.out.println(answer);
        sc.close();
    }
}

Compiler output:
Main.java:44: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.Scanner;

public class Grid1 {
    private static int R;
    private static int C;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        R = sc.nextInt();
        C = sc.nextInt();

        char[][] arr = new char[R + 1][C + 1];
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int r = sc.nextInt();
            int c = sc.nextInt();
            arr[r][c] = 1;
        }
        
        int[][] dp = new int[R + 1][C + 1];
        
        for(int i = 1; i<= R; i++) {
          for(int j = 1; j <= C; j++) {
            
            if(i == 1 && j == 1) {
               dp[i][j] == 1;
            } else if(i == 1) {
              dp[i][j] == arr[i][j] == 1 ? 0 : dp[i][j - 1];
            } else if(j == 1) {
              dp[i][j] == arr[i][j] == 1 ? 0 : dp[i - 1][j];
            } else {
              if(arr[i][j] == 1) {
                dp[i][j] = 0;
              } else {
                dp[i][j] = Math.min(dp[i][j - 1], dp[i - 1][j]) + 1;
              }
          }
        }
          
        int answer = dp[R][C] % 1000000007;
          System.out.println(answer);
        sc.close();
    }
}

Compiler output:
Main.java:26: error: not a statement
               dp[i][j] == 1;
                        ^
Main.java:28: error: not a statement
              dp[i][j] == arr[i][j] == 1 ? 0 : dp[i][j - 1];
                                         ^
Main.java:30: error: not a statement
              dp[i][j] == arr[i][j] == 1 ? 0 : dp[i - 1][j];
                                         ^
Main.java:44: error: reached end of file while parsing
}
 ^
4 errors
Language: C++

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

#define int long long
#define pb push_back
#define mod 1000000007
#define endl '\n'
#define w(x) int x;cin>>x; while(x-->0)

void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
// int N=1e5+1;
char arr[100001][100001];
int dp[100001][100001];
int n, m;
int dfs(int x, int y)
{
    if (x > n || y > m || arr[x][y] == '#')
        return 0;
    if (x == n && y == m)
        return 1;
    if (dp[x][y] != -1)
        return dp[x][y];
    int sum = 0;
    sum += dfs(x + 1, y) % mod;
    sum += dfs(x, y + 1) % mod;
    return dp[x][y] = sum % mod;
}
void mysol()
{
    cin >> n >> m;

    memset(arr, '#', sizeof(arr));
    memset(dp, -1, sizeof(dp));

    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= m; j++)
            cin >> arr[i][j];
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++)
            clog << arr[i][j];
        clog << endl;
    }
    cout << dfs(1, 1);

    return;
}

int32_t main()
{
    //fast();
    // w(t)
    {
        mysol();
    }
    return 0;
}


Compiler output:
/tmp/ccot0pcG.o: in function `dfs(long long, long long)':
a.cc:(.text+0x7e): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccot0pcG.o
a.cc:(.text+0x8b): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccot0pcG.o
a.cc:(.text+0xc5): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccot0pcG.o
a.cc:(.text+0xd2): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccot0pcG.o
a.cc:(.text+0x103): relocation truncated to fit: R_X86_64_PC32 against symbol `dp' defined in .bss section in /tmp/ccot0pcG.o
a.cc:(.text+0x12e): relocation truncated to fit: R_X86_64_PC32 against symbol `dp' defined in .bss section in /tmp/ccot0pcG.o
a.cc:(.text+0x22d): relocation truncated to fit: R_X86_64_PC32 against symbol `dp' defined in .bss section in /tmp/ccot0pcG.o
a.cc:(.text+0x252): relocation truncated to fit: R_X86_64_PC32 against symbol `dp' defined in .bss section in /tmp/ccot0pcG.o
/tmp/ccot0pcG.o: in function `mysol()':
a.cc:(.text+0x267): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccot0pcG.o
a.cc:(.text+0x283): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccot0pcG.o
a.cc:(.text+0x2c8): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

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

#define int long long
#define pb push_back
#define mod 1000000007
#define endl '\n'
#define w(x) int x;cin>>x; while(x-->0)

void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
int N=1e5+1;
char arr[N][N];
int dp[N][N];
int n, m;
int dfs(int x, int y)
{
    if (x > n || y > m || arr[x][y] == '#')
        return 0;
    if (x == n && y == m)
        return 1;
    if (dp[x][y] != -1)
        return dp[x][y];
    int sum = 0;
    sum += dfs(x + 1, y) % mod;
    sum += dfs(x, y + 1) % mod;
    return dp[x][y] = sum % mod;
}
void mysol()
{
    cin >> n >> m;

    memset(arr, '#', sizeof(arr));
    memset(dp, -1, sizeof(dp));

    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= m; j++)
            cin >> arr[i][j];
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++)
            clog << arr[i][j];
        clog << endl;
    }
    cout << dfs(1, 1);

    return;
}

int32_t main()
{
    //fast();
    // w(t)
    {
        mysol();
    }
    return 0;
}


Compiler output:
a.cc:21:13: error: size of array 'arr' is not an integral constant-expression
   21 | char arr[N][N];
      |             ^
a.cc:21:10: error: size of array 'arr' is not an integral constant-expression
   21 | char arr[N][N];
      |          ^
a.cc:22:11: error: size of array 'dp' is not an integral constant-expression
   22 | int dp[N][N];
      |           ^
a.cc:22:8: error: size of array 'dp' is not an integral constant-expression
   22 | int dp[N][N];
      |        ^
Language: C++

#include <cstdio>
#include <numeric>
#include <cmath>
#include <iostream>
#include <set>
#include <array>
using i64 = long long;
using namespace std;

const int mod = 1e9 + 7;
const int maxh = 1e5;
const int maxw = 1e5;
array<int, 2> r[3002];
int dp[3002];
int f[maxh + maxw + 1];
int fi[maxh + maxw + 1];

int pow_mod(int b, int e) {
  int r = 1;
  while (e) {
    if (e & 1) r = (i64) r * b % mod;
    e >>= 1;
    b = (i64) b * b % mod;
  }
  return r;
}

void precompute_factorials() {
  f[0] = 1;
  for (int i = 1; i <= maxh + maxw; i++) {
    f[i] = (i64) f[i - 1] * i % mod;
  }
  fi[maxh + maxw] = pow_mod(f[maxh + maxw], mod - 2);
  for (int i = maxh + maxw - 1; i >= 0; i--) {
    fi[i] = (i64) fi[i + 1] * (i + 1) % mod;
  }
}

int ways(array<int, 2> &a, array<int, 2> &b) {
  int dx = b[0] - a[0];
  int dy = b[1] - a[1];
  if (dy < 0) {
    return 0;
  }
  return (i64) f[dx + dy] * fi[dx] % mod * fi[dy] % mod;
}

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

  precompute_factorials();  

  int H, W, N;
  cin >> H >> W >> N;
  r[0][0] = 1;
  r[0][1] = 1;
  r[N + 1][0] = H;
  r[N + 1][1] = W;
  for (int i = 1; i <= N; i++) {
    cin >> r[i][0] >> r[i][1];
  }

  sort(r + 1, r + (N + 1));
  // cout << r[1][0] << " " << r[1][1] << "\n";
  dp[0] = 1;
  for (int i = 1; i <= N + 1 ; i++) {
    dp[i] = ways(r[0], r[i]);
    for (int j = 1; j < i; j++) {
      dp[i] = (dp[i] + mod - (i64) dp[j] * ways(r[j], r[i]) % mod) % mod;
    }
  }

  cout << dp[N + 1] << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   64 |   sort(r + 1, r + (N + 1));
      |   ^~~~
      |   sqrt
Language: C++

/**
 *     author: qodjf
 *     created: 04.11.2020 20:40:54
 */
#include <bits/stdc++.h>
using namespace std;

string to_string(string s) { return '"' + s + '"'; }

string to_string(const char* s) { return to_string((string)s); }

string to_string(bool b) { return (b ? "true" : "false"); }

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifndef ONLINE_JUDGE
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define dbg(...) 42
#endif

#define mst(x, a) memset(x, a, sizeof(x))

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;
const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const ll MOD = 1e9 + 7;

int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
ll mul(ll a, ll b) { return a * b % MOD; }

ll add(ll a, ll b) { return (a + b) % MOD; }

ll sub(ll a, ll b) { return (a - b + MOD) % MOD; }

ll my_pow(ll a, ll b) {
  ll r = 1;
  while (b) {
    if (b & 2) r = mul(r, a);
    a = mul(a, a);
    b >>= 1;
  }
  return r;
}

ll my_inv(ll a) { return my_pow(a, MOD - 2); }

namespace Comb {
const int MAXK = 2e5 + 5;
int fac[MAXK], inv_fac[MAXK];

void init() {
  fac[0] = inv_fac[0] = 1;
  for (int i = 1; i < MAXK; ++i) {
    fac[i] = mul(fac[i - 1], i);
    inv_fac[i] = my_inv(fac[i]);
  }
}

int C(int a, int b) {
  if (a < 0 || b < 0 || b > a) {
    return 0;
  }
  return mul(fac[a], mul(inv_fac[b], inv_fac[a - b]));
}

}  // namespace Comb

int f(int a, int b) { return Comb::C(a + b, b); }

int main() {
  int H, W, N;
  scanf("%d%d%d", &H, &W, &N);
  vector<P> in(N);
  for (int i = 0; i < N; i++) {
    scanf("%d%d", &in[i].first, &in[i].second);
  }
  in.emplace_back(H, W);
  sort(in.begin(), in.end(), [&](pair<int, int> a, pair<int, int> b) {
    return a.first + a.second < b.first + b.second;
  });

  Comb::init();

  // dp[i] - the number of paths to vertex in[i] such that it's the first
  // forbidden vertex
  vector<int> dp(n + 1);
  for (int i = 0; i <= N; ++i) {
    int tmp = f(in[i].first - 1, in[i].second - 1);
    for (int j = 0; j < i; ++j) {
      if (in[j].first <= in[i].first && in[j].second <= in[i].second) {
        tmp = sub(tmp, mul(dp[j], f(in[i].first - in[j].first,
                                    in[i].second - in[j].second)));
      }
    }
    dp[i] = tmp;
  }

  printf("%d\n", dp[N]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:116:18: error: 'n' was not declared in this scope
  116 |   vector<int> dp(n + 1);
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define db "ONEPIECE"
#define fi first
#define se second
#define endl '\n'
#define int long long
const int INF = 1e15 + 1;
const int mod = 1e9 + 7;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<PII, int> PII2;
typedef pair<int, PII> PII3;

void docfile()
{
    if (ifstream("FORM.inp"))
    {
        freopen("FORM.inp", "r", stdin);
        freopen("FORM.out", "w", stdout);
    }
    else if (ifstream(db".inp"))
    {
        freopen(db".inp", "r", stdin);
        freopen(db".out", "w", stdout);
    }
}

//---------------------------------------------------------------------------
const int N = 1e5 + 2;
int n, m, k;
PII safe[3010];

int f[3010], fac[N];
int sumA[3010], sumB[3010];

int nhan(int a, int b)
{
    if(b == 0) return 0;
    int t = nhan(a, b / 2);
    t = (t + t) % mod;
    if(b % 2) t = (t + a) % mod;
    return t;
}

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

    C[0] = 1;

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

void sub2()
{
    sort(safe+1, safe+k+1);
    k++;
    safe[k] = {n, m};

    for(int i = 1; i <= k; i++)
    {
        sumA[i] = binomial(safe[i].fi + safe[i].se - 2, safe[i].fi - 1);
        for(int j = 1; j < i; j++)
        {
            if(safe[j].fi <= safe[i].fi && safe[j].se <= safe[i].se)
            {
                int x = safe[i].fi - safe[j].fi + 1;
                int y = safe[i].se - safe[j].se + 1;
                int z = binomial(x + y - 2, x - 1);
                (sumB[i] += nhan(z, f[j])) %= mod;
            }
        }
        f[i] = (sumA[i] - sumB[i] + mod) % mod;
    }
    cout << f[k];
}

void solve()
{
    sub2();

}

void input()
{
    cin >> n >> m >> k;
    for(int i = 1; i <= k; i++)
    {
        cin >> safe[i].fi >> safe[i].se;
        ok[safe[i].fi][safe[i].se] = 1;
    }
    solve();
}

main()
{
    docfile();
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    int test = 1;
    //cin >> test;
    while(test--)
    input();
}



Compiler output:
a.cc: In function 'void input()':
a.cc:99:9: error: 'ok' was not declared in this scope; did you mean 'k'?
   99 |         ok[safe[i].fi][safe[i].se] = 1;
      |         ^~
      |         k
a.cc: At global scope:
a.cc:104:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  104 | main()
      | ^~~~
Language: C++

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

signed main()
{
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ll h, w, k;
  cin >> h >> w >> k;
  vvi dp(h+1,vi(w+1,0));
  for (int i = 0; i <= h; i++)
    	dp[i][0] = 1;
  for (int i = 0; i <= w; i++)
    	dp[0][i] = 1;
  ll a, b;
  for (int i = 0; i < k; i++)
  	cin >> a >> b, dp[h - a + 1][b] = -1;
  for (int i = 1; i <= h; i++)
    for (int j = 1; j <= w; j++)
    {
      if (dp[i][j] == -1)
          	continue;
 	  if (dp[i-1][j] != -1)
        	dp[i][j] += dp[i-1][j];
      if (dp[i][j-1] != -1)
        	d[i][j] += dp[i][j-1];
      dp[i][j] %= (ll)1e9+7;
    }
  cout << dp[h][w] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:17: error: 'd' was not declared in this scope
   30 |                 d[i][j] += dp[i][j-1];
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll mod=1e9+7;
int main(){
	ll h,w,n;
	cin>>h>>w>>n;
	ll a[h+1][w+1];
	ll dp[h+1][w+1];
	memset(a,0,sizeof(a));
	memset(dp,0,sizeof(dp));
	for(int i=0;i<n;i++){
		ll x,y;
		cin>>x>>y;
		a[x][y]=1;
		
		
	}
	dp[1][1]=1;
	for(int i=1;i<=h;i++){
		for(int j=1;j<=n;j++){
			if(a[i][j]==0){
				dp[i][j]=dp[i-1][j]+dp[i][j-1];
				dp%=mod;
			}
		}
	}
	cout<<dp[h][w];
	
	
	return 0;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:35: error: invalid operands of types 'long long int [(h + 1)][(w + 1)]' and 'long long int' to binary 'operator%'
   24 |                                 dp%=mod;
      |                                 ~~^~~~~
a.cc:24:35: note:   in evaluation of 'operator%=(long long int [(h + 1)][(w + 1)], long long int)'