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

#include <stdio.h>

#define max 100000

int main()
{
    int A, B, M, i, j, k, rei[max], dens[max], ans1, ans2, test1=max, test2=max;
    int proA[max], proB[max], ticket[max];
    
    scanf("%d %d %d", &A, &B, &M);
    
    for(i=0; i<A; i++){
        scanf("%d", &proA[i]);
    }
    for(j=0; j<B; j++){
        scanf("%d", &proB[j]);
    }
    
    for (k=0; k<M; k++) {
        scanf("%d %d %d", &rei[k], &dens[k], &ticket[k]);
    }
    
    for(i=0; i<M; i++){
        ans1 = proA[rei[i]-1]+proB[dens[i]-1]-ticket[i];
        if(test1>ans1)
            test1=ans1;
    }
    
    min=proA[0];
   for(i=1; i<A; i++){
       if(min>proA[i]){
      min = proA[i];
       }
  }
 

            
        for(j=0; j<B; j++){
            ans2 = min+proB[j];
            if(test2>ans2)
                test2=ans2;
        }
    
    if(test1<test2)
        printf("%d", test1);
    else
        printf("%d", test2);
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:29:5: error: 'min' undeclared (first use in this function); did you mean 'main'?
   29 |     min=proA[0];
      |     ^~~
      |     main
main.c:29:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

#define max 100000

int main()
{
    int A, B, M, i, j, k, rei[max], dens[max], ans1, ans2, test1=max, test2=max;
    int proA[max], proB[max], ticket[max];
    
    scanf("%d %d %d", &A, &B, &M);
    
    for(i=0; i<A; i++){
        scanf("%d", &proA[i]);
    }
    for(j=0; j<B; j++){
        scanf("%d", &proB[j]);
    }
    
    for (k=0; k<M; k++) {
        scanf("%d %d %d", &rei[k], &dens[k], &ticket[k]);
    }
    
    for(i=0; i<M; i++){
        ans1 = proA[rei[i]-1]+proB[dens[i]-1]-ticket[i];
        if(test1>ans1)
            test1=ans1;
    }
    
    min=proA[0];
   for(i=1;i<A;++i){
    if( min > proA[i] )
      min = proA[i];
  }
 

            
        for(j=0; j<B; j++){
            ans2 = min+proB[j];
            if(test2>ans2)
                test2=ans2;
        }
    
    if(test1<test2)
        printf("%d", test1);
    else
        printf("%d", test2);
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:29:5: error: 'min' undeclared (first use in this function); did you mean 'main'?
   29 |     min=proA[0];
      |     ^~~
      |     main
main.c:29:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

#define max 100000

int main()
{
    int A, B, M, i, j, k, rei[max], dens[max], ans1, ans2, test1=max, test2=max;
    int proA[max], proB[max], ticket[max];
    
    scanf("%d %d %d", &A, &B, &M);
    
    for(i=0; i<A; i++){
        scanf("%d", &proA[i]);
    }
    for(j=0; j<B; j++){
        scanf("%d", &proB[j]);
    }
    
    for (k=0; k<M; k++) {
        scanf("%d %d %d", &rei[k], &dens[k], &ticket[k]);
    }
    
    for(i=0; i<M; i++){
        ans1 = proA[rei[i]-1]+proB[dens[i]-1]-ticket[i];
        if(test1>ans1)
            test1=ans1;
    }
    
    min=proA[0];
   for(i=1;i<A;++i){
    if( min > a[i] )
      min = a[i];
  }
 

            
        for(j=0; j<B; j++){
            ans2 = min+proB[j];
            if(test2>ans2)
                test2=ans2;
        }
    
    if(test1<test2)
        printf("%d", test1);
    else
        printf("%d", test2);
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:29:5: error: 'min' undeclared (first use in this function); did you mean 'main'?
   29 |     min=proA[0];
      |     ^~~
      |     main
main.c:29:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:31:15: error: 'a' undeclared (first use in this function)
   31 |     if( min > a[i] )
      |               ^
Language: C++

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

int main(){
  int A,B,M;
  cin >> A >> B >> M;
  vector<int> r(A);
  vector<int> m(B);
  int a[M][3];
  for (int i = 0; i < A; i++)
  {
    cin >> r.at(i);
  }
  for (int i = 0; i < B; i++)
  {
    cin >> m.at(i);
  }
  for (int i = 0; i < M; i++)
  {
    cin >> a[i][0] >> a[i][1] >> a[i][2];
  }

  priority_queue<int, vector<int>, greater<int>> result;

  for (int i = 0; i < M; i++)
  {
    int x=a[i][0], y=a[i][1], z=a[i][2];
    result.push(r.at(x-1)+m.at(y-1)-z);
  }
  int minA = min_element(r.begin(),r.end());
  int minB = min_element(m.begin(),m.end());
  result.push(minA+minB);
  
  cout << result.top() << endl;
  return 0;   

}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:25: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   30 |   int minA = min_element(r.begin(),r.end());
      |              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
      |                         |
      |                         __gnu_cxx::__normal_iterator<int*, std::vector<int> >
a.cc:31:25: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   31 |   int minB = min_element(m.begin(),m.end());
      |              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
      |                         |
      |                         __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C

#include <stdio.h>

#define max 100000

int main()
{
    int A, B, M, i, j, k, rei[max], dens[max], ans1, ans2, test1=max, test2=max, flag=0;
    int proA[max], proB[max], ticket[max];
    
    scanf("%d %d %d", &A, &B, &M);
    
    for(i=0; i<A; i++){
        scanf("%d", &proA[i]);
    }
    for(j=0; j<B; j++){
        scanf("%d", &proB[j]);
    }
    
    for (k=0; k<M; k++) {
        scanf("%d %d %d", &rei[k], &dens[k], &ticket[k]);
    }
    
    for(i=0; i<M; i++){
        ans1 = proA[rei[i]-1]+proB[dens[i]-1]-ticket[i];
        if(test1>ans1)
            test1=ans1;
    }
    
    for (i=0; i<A; i++) {
        if(proA[i]>proA[i+1])
            flag=proA[i+1];
        else
            flag=proA[i]
        }
            
        for(j=0; j<B; j++){
            ans2 = flag+proB[j];
            if(test2>ans2)
                test2=ans2;
        }
    
    if(test1<test2)
        printf("%d", test1);
    else
        printf("%d", test2);
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:33:25: error: expected ';' before '}' token
   33 |             flag=proA[i]
      |                         ^
      |                         ;
   34 |         }
      |         ~
Language: C++

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

int main() {

    int a,b,m;

    cin >> a >> b >> m;

    vector<int> s(a);
    vector<int> t(b);

    vector<int> x(m);
    vector<int> y(m);
    vector<int> c(m);
    vector<vector<int>> data(a, vector<int>(b));

    int sum=0,count=0;

    for(int i=0;i<a;i++) cin >> s[i];
    for(int j=0;j<b;j++) cin >> t[j];

    for(int i=0;i<a;i++){
        for(int j=0;j<b;j++){
            data[i][j] = 0;
        }
    }

    for(int i=0;i<m;i++){
        cin >> x[i] >> y[i] >> c[i];
        data[x[i]-1][y[i]-1] = 0 - c[i];
    }
    
    sum = data[0][0] + s[0] +t[0];

    for(int i=0;i<a;i++){
        for(int j=0;j<b;j++){
            data[i][j] = data[i][j] + s[i] + t[j];
    
            if(data[i][j] < 0) data[i][j] = 0;     
            if(sum >= data[i][j]) sum = data[i][j];
        }
    }
    

    cout << sum << endl;

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

int main() {

    int a,b,m;

    cin >> a >> b >> m;

    vector<int> s(a);
    vector<int> t(b);

    vector<int> x(m);
    vector<int> y(m);
    vector<int> c(m);
    vector<vector<int>> data(a, vector<int>(b));

    int sum=0,count=0;

    for(int i=0;i<a;i++) cin >> s[i];
    for(int j=0;j<b;j++) cin >> t[j];

    for(int i=0;i<a;i++){
        for(int j=0;j<b;j++){
            data[i][j] = 0;
        }
    }

    for(int i=0;i<m;i++){
        cin >> x[i] >> y[i] >> c[i];
        data[x[i]-1][y[i]-1] = 0 - c[i];
    }
    
    sum = data[0][0] + s[0] +t[0];

    for(int i=0;i<a;i++){
        for(int j=0;j<b;j++){
            data[i][j] = data[i][j] + s[i] + t[j];
    
            if(data[i][j] < 0) data[i][j] = 0;     
            if(sum >= data[i][j]) sum = data[i][j];
        }
    }
    

    cout << sum << endl;

}


Compiler output:
a.cc:52:5: error: redefinition of 'int main()'
   52 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define GET_ARRAY_SIZE(a)   (sizeof(a)/sizeof(a[0]))
int main(){
    int a,b,m;
    cin >> a >> b >> m;
    int a_kin[a],b_kin[b];
//    vector<int> a_kin(a),b_kin(b);
    int len = (a*b) + m;
    int ans_kin[len];
//    vector<int> ans_kin((a*b)+m);
    int di[m][3];
//    vector<int> di(m,3);
    rep(i,a){
        cin >> a_kin[i];
    }
    rep(i,b){
        cin >> b_kin[i];
    }
    rep(i,m){
        rep(j,3){
            cin >> di[i][j];
        }
    }    
/*
    cout << a << " " << b << " " << m << endl;
    rep(i,a){
        cout << a_kin[i] << " ";
    }
    cout << endl;
    rep(i,b){
        cout << b_kin[i] << " ";
    }
    cout << endl;
    rep(i,m){
        rep(j,3){
            cout << di[i][j] << " ";
        }
        cout << endl;
    }
*/
    int num = 0;
    rep(i,a){
        rep(j,b){
            ans_kin[num] = a_kin[i] + b_kin[j];
            num += 1;
        }
    }
    rep(i,m){
        ans_kin[num] = a_kin[di[i][0] -1] + b_kin[di[i][1] -1] - di[i][2];
        num += 1;
    }
/*
    cout << num << endl;
    rep(i,ans_kin.size()){
        cout << ans_kin[i] <<" ";
    }
    cout << endl;
*/
    sort(ans_kin.begin(),ans_kin.end());
    cout << ans_kin[0] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:18: error: request for member 'begin' in 'ans_kin', which is of non-class type 'int [len]'
   61 |     sort(ans_kin.begin(),ans_kin.end());
      |                  ^~~~~
a.cc:61:34: error: request for member 'end' in 'ans_kin', which is of non-class type 'int [len]'
   61 |     sort(ans_kin.begin(),ans_kin.end());
      |                                  ^~~
Language: C

#include<stdio.h>
int main(void)
{
	int e,f,m,k;
	scanf("%d",e);
	scanf("%d",f);
	scanf("%d",m);

	int a[e], b[f], x[m], y[m], c[m];

	for(k=0; k<e; k++){
		scanf("%s", a);
	}
	for(k=0; k<f; k++){
		scanf("%s", b);
	}
	for(k=0; k<m; k++){
		scanf("%d", x[k]);
		scanf("%d", y[k]);
		scanf("%d", z[k]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:29: error: 'z' undeclared (first use in this function)
   20 |                 scanf("%d", z[k]);
      |                             ^
main.c:20:29: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define GET_ARRAY_SIZE(a)   (sizeof(a)/sizeof(a[0]))
int main(){
    int a,b,m;
    cin >> a >> b >> m;
    int a_kin[a],b_kin[b];
//    vector<int> a_kin(a),b_kin(b);
    int ans_kin[(a*b)+m];
//    vector<int> ans_kin((a*b)+m);
    int di[m][3];
//    vector<int> di(m,3);
    rep(i,a){
        cin >> a_kin[i];
    }
    rep(i,b){
        cin >> b_kin[i];
    }
    rep(i,m){
        rep(j,3){
            cin >> di[i][j];
        }
    }    
/*
    cout << a << " " << b << " " << m << endl;
    rep(i,a){
        cout << a_kin[i] << " ";
    }
    cout << endl;
    rep(i,b){
        cout << b_kin[i] << " ";
    }
    cout << endl;
    rep(i,m){
        rep(j,3){
            cout << di[i][j] << " ";
        }
        cout << endl;
    }
*/
    int num = 0;
    rep(i,a){
        rep(j,b){
            ans_kin[num] = a_kin[i] + b_kin[j];
            num += 1;
        }
    }
    rep(i,m){
        ans_kin[num] = a_kin[di[i][0] -1] + b_kin[di[i][1] -1] - di[i][2];
        num += 1;
    }
/*
    cout << num << endl;
    rep(i,ans_kin.size()){
        cout << ans_kin[i] <<" ";
    }
    cout << endl;
*/
    sort(ans_kin.begin(),ans_kin.end());
    cout << ans_kin[0] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:18: error: request for member 'begin' in 'ans_kin', which is of non-class type 'int [((a * b) + m)]'
   60 |     sort(ans_kin.begin(),ans_kin.end());
      |                  ^~~~~
a.cc:60:34: error: request for member 'end' in 'ans_kin', which is of non-class type 'int [((a * b) + m)]'
   60 |     sort(ans_kin.begin(),ans_kin.end());
      |                                  ^~~
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;

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 main()
{
 
  
  int A, B, M;
  cin >> A >> B >> M;

  int a[A], b[B];
  for(int i=0; i<A; i++)
    cin >> a[i];
  for(int i=0; i<B; i++)
    cin >> b[i];

cout << "why" << endl;
  return 0;
  
  //vector<ll> x(M), y(M), c(M);
  
  ll table[A][B];
  for(int i=0; i<A; i++)
    for(int j=0; j<B; j++)
      table[i][j]=0;

  
  for(int i=0; i<M; i++)
    {
      int x, y, c;
      cin >> x >> y >> c;
      if(table[x-1][y-1]<c)
	table[x-1][y-1]=c;
    }

 
  
  ll minval=10010;
  ll val;
  for(int i=0; i<A; i++)
    {
      for(int j=0; j<B; j++)
	{
	  val = a[i]+b[j]-table[i][j];
	  
	  if(val<minval)
	    minval = val;
	}
    }

  cout << minval << endl;
  


  return 0;
}


//cout << setprecision(13);
//next_permutation();
//__gcd();
//reverse();
//set ,tuple ,pair;
//bitset
//vector.find
//vector.count



Compiler output:
a.cc:1:1: error: stray '\' in program
    1 | \#include <bits/stdc++.h>
      | ^
a.cc:1:2: error: stray '#' in program
    1 | \#include <bits/stdc++.h>
      |  ^
a.cc:1:3: error: 'include' does not name a type
    1 | \#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:8:9: error: 'pair' does not name a type
    8 | typedef pair<int, int> P;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:18:3: error: 'cin' was not declared in this scope
   18 |   cin >> A >> B >> M;
      |   ^~~
a.cc:26:1: error: 'cout' was not declared in this scope
   26 | cout << "why" << endl;
      | ^~~~
a.cc:26:18: error: 'endl' was not declared in this scope
   26 | cout << "why" << endl;
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
 
#define REP(i,s,N) for (int i=s;i<(N); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;


int main(){
	ll A,B,M;
	cin >> A >> B >> M;
	vector<ll> a(A);
	vector<ll> b(B);
	REP(i,0,A){
		cin >> a.at(i);
	}
	REP(i,0,B){
		cin >> b.at(i);
	}
	
	vector<pair<ll,ll>> xy(M);
	vector<ll> c(M);
	REP(i,0,M){
		ll x_tmp,y_tmp,c_tmp;
		cin >> x_tmp >> y_tmp >> c_tmp;
		xy.at(i) = make_pair(x_tmp,y_tmp);
		c.at(i) = c_tmp;
	}
	
	vector<ll>> sum(A*B);
 	REP(i,0,A){
		REP(j,0,B){
			sum.at(i*A+j) = a.at(i) + b.at(j);
		}
	}
	REP(k,0,M){
		ll xx = xy.at(k).first;
		ll yy = xy.at(k).second;
		sum.at(xx*A+yy) -= c.at(k);
	}
	
	sort(sum.begin(),sum.end());
	
	
	
	cout << sum.at(0) << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:18: error: expected unqualified-id before '>' token
   30 |         vector<ll>> sum(A*B);
      |                  ^~
a.cc:33:25: error: 'sum' was not declared in this scope
   33 |                         sum.at(i*A+j) = a.at(i) + b.at(j);
      |                         ^~~
a.cc:39:17: error: 'sum' was not declared in this scope
   39 |                 sum.at(xx*A+yy) -= c.at(k);
      |                 ^~~
a.cc:42:14: error: 'sum' was not declared in this scope
   42 |         sort(sum.begin(),sum.end());
      |              ^~~
Language: C++

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

int main(){
  long long a,b,n,sum[a][b],cnt=0,min=0;
  cin>>a>>b>>n;
  int sa[a],sb[b],sn[n][3];
  for(int i=0;i<a;i++){
      cin>>sa[i];
  }
  for(int i=0;i<b;i++){
      cin>>sb[i];
  }
  for(int i=0;i<n;i++){
      cin>>sn[i][0]>>sn[i][1]>>sn[i][2];
  }
   
  for(int i=0;i<a;i++){
    for(int j=0;j<b;j++){
       sum[i][j]=sa[i]+sb[j];
           }
       }
  for(int x=0;x<n;x++){
      i=sn[x][0];
      j=sn[x][1];
      sum[i][j]=sum[i][j]-sn[x][2];
  }
  min=0;
  for(int i=0;i<a;i++){
    for(int j=0;j<b;j++){
       if (sum[i][j]<min){
           min=sum[i][j];
       }
       }
       }
  cout<<min;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: 'i' was not declared in this scope
   24 |       i=sn[x][0];
      |       ^
a.cc:25:7: error: 'j' was not declared in this scope
   25 |       j=sn[x][1];
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define REPN(i,a,b) for (int i=a;i<=b;++i)

int main() {
  int A,B,M;
  cin>>A>>B>>M;
  int P[A],Q[B];
  REP(i,0,A) cin>>P[i];
  REP(i,0,B) cin>>Q[i];
  int a[m],b[m],c[m];
  REP(i,0,m){
  cin>>a[i]>>b[i]>>c[i];
  }
  int val=max_element(c,c+m);
  int index=max_element(c,c+m)-c;
  int cost=a[index]+b[index]-val;
  cout<<cost;
  
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'm' was not declared in this scope
   12 |   int a[m],b[m],c[m];
      |         ^
a.cc:14:8: error: 'a' was not declared in this scope
   14 |   cin>>a[i]>>b[i]>>c[i];
      |        ^
a.cc:14:14: error: 'b' was not declared in this scope
   14 |   cin>>a[i]>>b[i]>>c[i];
      |              ^
a.cc:14:20: error: 'c' was not declared in this scope
   14 |   cin>>a[i]>>b[i]>>c[i];
      |                    ^
a.cc:16:23: error: 'c' was not declared in this scope
   16 |   int val=max_element(c,c+m);
      |                       ^
a.cc:18:12: error: 'a' was not declared in this scope
   18 |   int cost=a[index]+b[index]-val;
      |            ^
a.cc:18:21: error: 'b' was not declared in this scope
   18 |   int cost=a[index]+b[index]-val;
      |                     ^
Language: C

x = []
y = []
z = []
x = input().split()


y = input().split()  #A

z = input().split()  #B

waribiki = []
nest = []
for i in range(int(x[2])):
    waribiki = input().split()
    nest.append(waribiki)

inu = 0
neko = 0
nedan = []
for i in range(len(nest)):
    inu = int(nest[i][0])
    neko = int(nest[i][1])
    nedan.append(int(y[inu-1])+int(z[neko-1])-int(nest[i][2]))


may = int(min(y)) + int(min(z)) #たぶんやすい
#print(may)

#割引券複数
if len(nedan) > 1:
    print(min(nedan))
elif int(may) <= min(nedan):
    print(may)
else:
    print(nedan[0])

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | x = []
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
main.c:1:5: error: expected expression before '[' token
    1 | x = []
      |     ^
main.c:7:22: error: stray '#' in program
    7 | y = input().split()  #A
      |                      ^
main.c:9:22: error: stray '#' in program
    9 | z = input().split()  #B
      |                      ^
main.c:26:33: error: stray '#' in program
   26 | may = int(min(y)) + int(min(z)) #たぶんやすい
      |                                 ^
main.c:27:2: error: invalid preprocessing directive #print
   27 | #print(may)
      |  ^~~~~
main.c:29:2: error: invalid preprocessing directive #\U00005272\U00005f15\U00005238\U00008907\U00006570
   29 | #割引券複数
      |  ^~~~~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define L 100000

#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))
#define SWAP(type, a, b)
{
    type work = a;
    a = b;
    b = work;
}

static void bubble_sort(int *array, size_t size);
static void print_array(const int *array, size_t size);

void bubble_sort(int *array, size_t size)
{
    for (size_t i = 0; i < size - 1; ++i)
    {
        for (size_t j = 1; j < size - i; ++j)
        {
            if (array[j - 1] > array[j])
            {
                SWAP(int, array[j - 1], array[j]);
            }
        }
    }
}

int main(void)
{
    int A, B, M;
    scanf("%d%d%d", &A, &B, &M);
    if (A<1 | A> L)
    {
        return -1;
    }
    else if (B<1 | B> L)
    {
        return -1;
    }
    else if (M<1 | M> L)
    {
        return -1;
    }
    int a[A], b[B], x[M], y[M], c[M],sum[M];
    int amin,bmin;
    for (int i = 0; i < A; i++)
    {
        scanf("%d", &a[i]);
        int k=a[i];
        if (a[i]<1 | a[i]> L){
            return -1;
            }else if(i=0){
                amin=a[i];
            }else if(amin>k){
                amin=k;
            }
    }
    for (int i = 0; i < B; i++)
    {
        scanf("%d", &b[i]);
        int k=b[i];
        if (b[i]<1 | b[i]> L){
            return -1;
        }
    else if (i == 0)
    {
        bmin = b[i];
    }
    else if (bmin > k)
    {
        bmin = k;
    }
    }
    for (int i = 0; i < M; i++)
    {
        scanf("%d%d%d", x[i], y[i], c[i]);
        if (x[i]<1 | x[i]> A)
        {
            return -1;
        }
        else if (y[i]<1 | y[i]> B)
        {
            return -1;
        }
        else if (c[i] > a[x[i]] + b[y[i]])
        {
            return -1;
        }
        x[i] = a[i];
        y[i] = b[i];
        sum[i]=x[i]+y[i]-c[i];
    }
    int k,l;
    for(int i=0;i<M;i++){
        if(i==0){
            k=sum[i];
        }else if(k>sum[i]){
            k=sum[i];
        }
    }
    return 0;
}

Compiler output:
main.c:9:1: error: expected identifier or '(' before '{' token
    9 | {
      | ^
Language: C++

#include<iostream>
using namespace std;
int main() {
  int A, B, M;
  cin >> A >> B >> M;
  
  int a;
  for (int i = 0; i < A; i++) {
    cin >> a;
    if (a < a) {
      a = a;
    }
    else {
      continue;
    }
  }
  
  
  int b;
  for (int j = 0; j < B; j++) {
    cin >> b;
    if (b < b) {
      b = b;
    }
    else {
      continue;
    }
  }
  
  int answer1 = a + b;
  
  int x, y, c;
  for (int k = 0; k < M; k++) {
    cin >> x >> y >> c;
  }
  
  int a;
  for (int i = 0; i < A; i++) {
    if (i = x) {
      a = a;
      break;
    }
    else {
      continue;
    }
  }
    
  int b;
  for (int i = 0; j < B; j++) {
    cin >> b;
    if (i = y) {
      b = b;
      break;
    }
  }
  
  
  
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:7: error: redeclaration of 'int a'
   37 |   int a;
      |       ^
a.cc:7:7: note: 'int a' previously declared here
    7 |   int a;
      |       ^
a.cc:48:7: error: redeclaration of 'int b'
   48 |   int b;
      |       ^
a.cc:19:7: note: 'int b' previously declared here
   19 |   int b;
      |       ^
a.cc:49:19: error: 'j' was not declared in this scope
   49 |   for (int i = 0; j < B; j++) {
      |                   ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main()
{
  int A, B, M;
  cin >> A >> B >> M;
  vector<int> a(A);
  vector<int> b(B);
  for (int i = 0; i < A; i++)
  {
    cin >> a[i];
  }
  for (int i = 0; i < B; i++)
  {
    cin >> b[i];
  }
  vector<int> x(M);
  vector<int> y(M);
  vector<int> c(M);
  for (int i = 0; i < M; i++) {
    cin >> x[i] >> y[i] >> c[i];
    x[i] -= 1; y[i] -= 1;
  }
  vector<vector<int>> vec2(B);
  vector<int> vec1(A);
  int min = a[0] + b[0];
  for (int i = 0; i < B; i++)
  {
    for (int j = 0; j < A; j++)
    {
      vec1[j] = a[j] + b[i];
    }
    vec2[i] = vec1;
  }
  int mina = a[0];
  int minb = b[0];
  for (int i = 1; i < A; i++) {
    if (a[i] < mina) mina = a[i];
  }
  for (int i = 0i < B; i++) {
    if (b[i] < minb) minb = b[i];
  }
  min = mina + minb;
  for (int i = 0; i < M; i++)
  {
    if (min >= (vec2[y[i]][x[i]] - c[i]))
      min = (vec2[y[i]][x[i]] - c[i]);
  }
  cout << min;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:19: error: invalid operands of types '__complex__ int' and 'int' to binary 'operator<'
   41 |   for (int i = 0i < B; i++) {
a.cc:41:27: error: expected ';' before ')' token
   41 |   for (int i = 0i < B; i++) {
      |                           ^
      |                           ;
Language: C++

#include<bits/stdc++.h>
 
#define REP(i,s,N) for (int i=s;i<(N); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;


int main(){
	ll A,B,M;
	cin >> A >> B >> M;
	vector<ll> a(A);
	vector<ll> b(B);
	REP(i,0,A){
		cin >> a.at(i);
	}
	REP(i,0,B){
		cin >> b.at(i);
	}
	
	vector<pair<ll,ll>> xy(M);
	vector<ll> c(M);
	REP(i,0,M){
		ll x_tmp,y_tmp,c_tmp;
		cin >> x_tmp >> y_tmp >> c_tmp;
		xy.at(i) = make_pair(x_tmp,y_tmp);
		c.at(i) = c_tmp;
	}
	
	vector<ll> sum(M*M);
	REP(i,0,M){
		REP(j,0,M){
			sum.at(i*M+j) = a.at(i) + b.at(j);
			REP(k,0,M){
				if(xy.at(k).first == a.at(i) && xy.at(k).second == b.at(j)){
					sum.at(i*N+j) -= c.at(k);
				}
			}
		}
	}
	sort(sum.begin(),sum.end());
	
	cout << sum.at(0) << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:50: error: 'N' was not declared in this scope
   36 |                                         sum.at(i*N+j) -= c.at(k);
      |                                                  ^
Language: C++

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

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main(){
    int A, B ,M, i,j,l;
    cin >> A;
    cin >> B;
    cin >> M;
    int a[A], b[B];
    long long c_m[A][B];
  
    for(int i=0;i<A;i++){
        cin >> j;
        a[i] = j;
    }
    for(int i=0;i<B;i++){
        cin >> j;
        b[i] = j;
    }
  	for(int i = 0;i<A;i++){
      for(int j = 0;j<B;j++){
        c_m[i][j] = 0; 
      }
    }

    for(int k=0; k<M;k++){
      	cin >> i;
      	cin >> j;
      	cin >> l;
		chmax(c_m[i-1][j-1], l);
    }

    int min_money = 1000000;
    int money;
  
  	for(int i=0;i<A;i++){
    	for(int j=0; i<B;i++){
            money = a[i] + b[j] - c_m[i][j]; 
            chmin(min_money,money);      	
        }
    }

    cout << min_money << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:22: error: no matching function for call to 'chmax(long long int&, int&)'
   33 |                 chmax(c_m[i-1][j-1], l);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~
a.cc:4:31: note: candidate: 'template<class T> bool chmax(T&, T)'
    4 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:4:31: note:   template argument deduction/substitution failed:
a.cc:33:22: note:   deduced conflicting types for parameter 'T' ('long long int' and 'int')
   33 |                 chmax(c_m[i-1][j-1], l);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~
Language: C++

A, B, M = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

for i in range(M):
  x, y, c = map(int, input().split())
  sum = a[x] + b[y] - c
  if i == 0:
	if sum < min(a) + min(b):
	  result = sum
    else:
      result = min(a) + min(b)
  else:
    if sum < result:
      result = sum

print(result)

Compiler output:
a.cc:1:1: error: 'A' does not name a type
    1 | A, B, M = map(int, input().split())
      | ^
Language: C++

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

int main()
{
	int a,b,m;
	cin>>a>>b>>m;
	int A[a+1],B[b+1],x[m+1],y[m+1],c[m+1];
	
	for(int i=1; i<=a; i++)
		cin>>A[i];
	
	for(int i=1; i<=b; i++)
		cin>>B[i];
	
	for(int i=1; i<=m; i++)	
		cin>>x[i]>>y[i]>>c[i];
	
	sort(A+1,A+a+1);
	sort(B+1,B+b+1);
	
	int sum=0,sum_2=A[i]+B[i],minv=1000000;
	for(int i=1; i<=m; i++)
	{
		sum+=A[x[i]]+B[y[i]]-c[i];
		if(sum<minv)
			minv=sum;
		
		sum=0;
	}
	
	if(sum_2<=minv)
		cout<<sum_2<<endl;
	else
		cout<<minv<< endl;
		
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:27: error: 'i' was not declared in this scope
   22 |         int sum=0,sum_2=A[i]+B[i],minv=1000000;
      |                           ^
a.cc:26:24: error: 'minv' was not declared in this scope
   26 |                 if(sum<minv)
      |                        ^~~~
a.cc:32:19: error: 'minv' was not declared in this scope
   32 |         if(sum_2<=minv)
      |                   ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  int a, b, m;
  cin >> a >> b >> m;
  int x[a], y[b], c[m];
  for(int i = 0; i < a; i++)
    cin >> x[i];
  for(int i = 0; i < b; i++)
    cin >> y[i];
  for(int i = 0; i < m; i++)
    cin >> xi[i] >> yi[i] >> c[i];
  int p = 200000;
  for(int i = 0; i < m; i++)
    if(p > x[xi[i]]+y[yi[i]]-c[i])
      p = x[xi[i]]+y[yi[i]]-c[i];
  sort(x, x+a);
  sort(y, y+b);
  int i = 0;
  while(p > x[i]+y[i]){
    p = x[i]+y[i];
    i++;
  }
  cout << p;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'xi' was not declared in this scope; did you mean 'i'?
   14 |     cin >> xi[i] >> yi[i] >> c[i];
      |            ^~
      |            i
a.cc:14:21: error: 'yi' was not declared in this scope; did you mean 'i'?
   14 |     cin >> xi[i] >> yi[i] >> c[i];
      |                     ^~
      |                     i
a.cc:17:14: error: 'xi' was not declared in this scope; did you mean 'i'?
   17 |     if(p > x[xi[i]]+y[yi[i]]-c[i])
      |              ^~
      |              i
a.cc:17:23: error: 'yi' was not declared in this scope; did you mean 'i'?
   17 |     if(p > x[xi[i]]+y[yi[i]]-c[i])
      |                       ^~
      |                       i
Language: C++

#include <iostream>
#include <vector>
#include <climits>

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

using namespace std;

int main(void){
    int A, B, M;

    cin >> A >> B >> M;

    int a[A], b[B];
    int x[M], y[M], z[M];

    rep(i, A){
        cin >> a[i];
    }
    rep(i, B){
        cin >> b[i];
    }

    rep(i, M){
        cin >> x[i] >> y[i] >> z[i];
    }

    vector<vector<int> > sum(A, vector<int>(B));

    rep(i, A){
        rep(j, B){
            sum[i][j] = a[i] + b[j];
        }
    }

    rep(i, M){
        sum[x[i]-1][y[i]-1] -= z[i];
    }

    int imin = INT_MAX;
    rep(i, A){
        imin = min(imin, (int)*min_element(sum[i].begin(), sum[i].end()));
    }

    cout << imin << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:32: error: 'min_element' was not declared in this scope
   42 |         imin = min(imin, (int)*min_element(sum[i].begin(), sum[i].end()));
      |                                ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
void solve()
{
    int a, b, m;
    cin >> a >> b >> m;
    int A[a], B[b];
    int ma = INT_MAX;
    int mb = INT_MAX;
    for (int i = 0; i < a; i++){
        cin >> A[i];
        ma = min(ma, A[i]);
    }

    for (int i = 0; i < b; i++){
        cin >> B[i];
        mb = min(mb, B[i]);
    }

    int x, y, c;
    long mn = LONG_MAX;
    for (int i = 0; i < m; i++)
    {
        cin >> x >> y >> c;
        long res = A[x - 1] + B[y - 1] - c;
        mn = min({mn, res, (long)(mb + ma});
    }
    cout << mn;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:26:42: error: expected ')' before '}' token
   26 |         mn = min({mn, res, (long)(mb + ma});
      |                                  ~       ^
      |                                          )
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int A,B,M;
    cin>>A>>B>>M;
    short a[A+1] = {0};
    short b[B+1] = {0};
    short dc[A+1][B+1] = {0};
    for(int i=1;i<=A;i++) cin>>a[i];
    for(int i=1;i<=B;i++) cin>>b[i];
    for(int i=1;i<=M;i++) {
        int x,y;
        cin>>x>>y>>c;
        dc[x][y] = min(dc[x][y],(short)-c);
    }
    for(int i=1;i<=A;i++) {
        for(int j=1;j<=B;j++) {
            dc[i][j] += (a[i]+b[j]);
        }
    }
    short ans = 0;
    for(int i=1;i<=A;i++) {
        for(int j=1;j<=B;j++) {
            if(ans == 0 || ans > dc[i][j]) {
                ans = dc[i][j];
            }
        }
    }
    cout<<ans<<"\n";
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
    int x[a],y[b],z[c];
for(int i=0;i<a;i++){
scanf("%d",&x[i]);
}
sort(x,x+a);

    for(int i=0;i<b;i++){
scanf("%d",&y[i]);
}
sort(y,y+b);
suma=x[0]+y[0];
    long long sum=0,temp=suma[0],p,q,r;
for(int i=0;i<c;i++){
    scanf("%d %d %d",&p,&q,&r);
sum=x[p-1]+y[q-1];
sum-=r;
if(sum<temp) temp=sum;
}
printf("%lld\n",temp);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:1: error: 'suma' was not declared in this scope
   17 | suma=x[0]+y[0];
      | ^~~~
a.cc:20:23: error: 'p' was not declared in this scope
   20 |     scanf("%d %d %d",&p,&q,&r);
      |                       ^
a.cc:20:26: error: 'q' was not declared in this scope
   20 |     scanf("%d %d %d",&p,&q,&r);
      |                          ^
a.cc:20:29: error: 'r' was not declared in this scope
   20 |     scanf("%d %d %d",&p,&q,&r);
      |                             ^
Language: C++

#include<stdio.h>
#include<stdlib.h>

int main(){

	long int A,B,M;
	int *a,*b,*c,*x,*y;
	int i;

	scanf("%ld %ld %ld",&A,&B,&M);
	a = calloc(A,sizeof(long int));
	b = calloc(B,sizeof(long int));
	x = calloc(M,sizeof(long int));
	y = calloc(M,sizeof(long int));
	c = calloc(M,sizeof(long int));
	for(i=0;i<A;i++){
		scanf(" %d",&a[i]);
	}
	for(i=0;i<B;i++){
		scanf(" %d",&b[i]);
	}
	for(i=0;i<M;i++){
		scanf(" %d",&x[i]);
		scanf(" %d",&y[i]);
		scanf(" %d",&c[i]);
	}

	int j,k;
	int test,test2;
	long int min=100000,min2=100000;

	for(i=0;i<A;i++){
		for(j=0;j<B;j++){
			test = a[i] + b[j];
			test2 = test;
			for(k=0;k<M;k++){
				if(x[k]==i&&y[k]==j){
					test2 = test2 - c[k];
					if(test2<min2){
						min2 = test2;
					}
					test2 = test;
					//printf("use x[%d],y[%d],c[%d]=%d\n",k,k,k,c[k]);
				}
			}
			if(min2!=100000){
				test = min2;
			}
			min2 = 100000;
			if(test<min){
				min = test;
			}
		}
	}

	printf("%ld",min);
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   11 |         a = calloc(A,sizeof(long int));
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:12:19: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   12 |         b = calloc(B,sizeof(long int));
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:13:19: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   13 |         x = calloc(M,sizeof(long int));
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:14:19: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   14 |         y = calloc(M,sizeof(long int));
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc:15:19: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   15 |         c = calloc(M,sizeof(long int));
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
Language: C++

#include <iostream>
#include <vector>
#include <array>

using namespace std;

int main()
{

  unsigned long long A,B,M;
  cin>>A>>B>>M;
  vector<unsigned long long> a;
  vector<unsigned long long> b;
  array<unsigned long long,3> c;
  
  unsigned long long min_a=pow(10,5);
  unsigned long long min_b=min_a;
  unsigned long long sum_min = 0;
  
  for(unsigned long long i=0;i<A;++i){
  	unsigned long long x;
    cin>>x;
    if(x<min_a)
      min_a = x;
    a.emplace_back(x);
  }
  cout<<endl;
  
   for(unsigned long long i=0;i<B;++i){
  	unsigned long long x;
    cin>>x;
    if(x<min_b)
      min_b = x;
    b.emplace_back(x);
  }
  cout<<endl;
  
  min_sum = min_a+min_b;
  for(unsigned long long j =0;j<M;++j){
  for(int i=0;i<3;++i){
  	cin>>c[i];
  }
    unsigned long long x = a[c[0]-1] + b[c[1]-1] - c[2];
    if(x<min_sum)
      min_sum = x;
  cout<<endl;
  }
  
 cout<<min_sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:28: error: 'pow' was not declared in this scope
   16 |   unsigned long long min_a=pow(10,5);
      |                            ^~~
a.cc:38:3: error: 'min_sum' was not declared in this scope; did you mean 'min_b'?
   38 |   min_sum = min_a+min_b;
      |   ^~~~~~~
      |   min_b
Language: C++

#include <iostream>
#include <vector>

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

using namespace std;

int main(void){
    int A, B, M;

    cin >> A >> B >> M;

    int a[A], b[B];
    int x[M], y[M], z[M];

    rep(i, A){
        cin >> a[i];
    }
    rep(i, B){
        cin >> b[i];
    }

    rep(i, M){
        cin >> x[i] >> y[i] >> z[i];
    }

    int min = INT_MAX;
    int sum, dis;

    rep(i, A){
        rep(j, B){
            sum = a[i] + b[j];
            dis = sum;
            rep(k, M){
                if(i+1 == x[k] && j+1 == y[k] && sum-z[k] < dis){
                    dis = sum - z[k];
                }
            }

            if(min > dis){
                min = dis;
            }
        }
    }

    cout << min << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:15: error: 'INT_MAX' was not declared in this scope
   27 |     int min = INT_MAX;
      |               ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <vector>
  +++ |+#include <climits>
    3 |
Language: C++

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

int minElement(const int* array, size_t size)
{
    assert(array != NULL);
    assert(size >= 1);

    int min = array[0];
    for (size_t i = 1; i < size; ++i) {
        if (min > array[i]) {
            min = array[i];
        }
    }

    return min;
}

int main() {
  int A, B, M;
  cin >> A >> B >> M;
  vector<int> a(A);
  for (int i = 0; i < A; i++) {
    cin >> a.at(i);
  }
  vector<int> b(B);
  for (int i = 0; i < B; i++) {
    cin >> b.at(i);
  }
  int min = minElement(a, SIZE_OF_ARRAY(a)) + minElement(b, SIZE_OF_ARRAY(b));
  for (int i = 0; i < M; i++) {
    int x, y, c;
    cin >> x >> y >> c;
    if (a.at(x - 1) + b.at(y - 1) - c < min) {
      min = a.at(x - 1) + b.at(y - 1) - c
    }
  }
  cout << min << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:27: error: 'SIZE_OF_ARRAY' was not declared in this scope
   30 |   int min = minElement(a, SIZE_OF_ARRAY(a)) + minElement(b, SIZE_OF_ARRAY(b));
      |                           ^~~~~~~~~~~~~
a.cc:35:42: error: expected ';' before '}' token
   35 |       min = a.at(x - 1) + b.at(y - 1) - c
      |                                          ^
      |                                          ;
   36 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int A, B ,M;
  cin>> A >> B >> M ;
  vector<int> veca(A);
  
  for (int i = 0; i < A; i++) {
  cin >> veca.at(i);
}
  
   vector<int> vecb(B);
  
  for (int i = 0; i < B; i++) {
  cin >> vecb.at(i);
}
 
 
  vector<vector<int>> data(M, vector<int>(3));
  for (int j = 0; j < M; j++) {
    for (int k = 0; k < 3; k++) {
  cin >> vecxyc.at(J).at(k);
    }
  }
  vector<int> vecc(M,0);
  for (int l =0; l <M; l++) {
    vecc.at(l)=veca.at(vecxyc.at(l).at(o))+vecb(vecxyc.at(l).at(1))-vecxyc.at(l).at(2);
  }
  sort(veca.begin(), vec.end());
  sort(vecb.begin(), vec.end());
  sort(vecc.begin(), vec.end());
  cin >>veca.at(0) >>vecb.at(0) >>vecc.at(0);
  int answer=min(veca.at(0)+vecb.at(0),vecc.at(0));
  cout << anawer <<endl;
  
    
  
  
  
    
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:24:10: error: 'vecxyc' was not declared in this scope
   24 |   cin >> vecxyc.at(J).at(k);
      |          ^~~~~~
a.cc:24:20: error: 'J' was not declared in this scope
   24 |   cin >> vecxyc.at(J).at(k);
      |                    ^
a.cc:29:24: error: 'vecxyc' was not declared in this scope; did you mean 'vecc'?
   29 |     vecc.at(l)=veca.at(vecxyc.at(l).at(o))+vecb(vecxyc.at(l).at(1))-vecxyc.at(l).at(2);
      |                        ^~~~~~
      |                        vecc
a.cc:29:40: error: 'o' was not declared in this scope
   29 |     vecc.at(l)=veca.at(vecxyc.at(l).at(o))+vecb(vecxyc.at(l).at(1))-vecxyc.at(l).at(2);
      |                                        ^
a.cc:31:22: error: 'vec' was not declared in this scope; did you mean 'vecc'?
   31 |   sort(veca.begin(), vec.end());
      |                      ^~~
      |                      vecc
a.cc:36:11: error: 'anawer' was not declared in this scope; did you mean 'answer'?
   36 |   cout << anawer <<endl;
      |           ^~~~~~
      |           answer
a.cc:36:25: error: expected '}' at end of input
   36 |   cout << anawer <<endl;
      |                         ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <array>

using namespace std;

int main()
{

  unsigned long long A,B,M;
  cin>>A>>B>>M;
  vector<unsigned long long> a;
  vector<unsigned long long> b;
  array<unsigned long long,3> c;
  a.resize(A);
  b.resize(B);
  
  unsigned long long min_a=pow(10,5);
  unsigned long long min_b=min_a;
  unsigned long long sum_min = 0;
  
  for(unsigned long long i=0;i<A;++i){
  	unsigned long long x;
    cin>>x;
    if(x<min_a)
      min_a = x;
    a.emplace_back(x);
  }
  cout<<endl;
  
   for(unsigned long long i=0;i<B;++i){
  	unsigned long long x;
    cin>>x;
    if(x<min_b)
      min_b = x;
    b.emplace_back(x);
  }
  cout<<endl;
  
  min_sum = min_a+min_b;
  for(unsigned long long j =0;j<M;++j){
  for(int i=0;i<3;++i){
  	cin>>c[i];
  }
    unsigned long long x = a[c[0]-1] + b[c[1]-1] - c[2];
    if(x<min_sum)
      min_sum = x;
  cout<<endl;
  }
  
 cout<<min_sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: 'pow' was not declared in this scope
   18 |   unsigned long long min_a=pow(10,5);
      |                            ^~~
a.cc:40:3: error: 'min_sum' was not declared in this scope; did you mean 'min_b'?
   40 |   min_sum = min_a+min_b;
      |   ^~~~~~~
      |   min_b
Language: C++

#include <iostream>

using namespace std;

void main()
{

  unsigned long long A,B,M;
  cin>>A>>B>>M;
  vector<unsigned long long> a;
  vector<unsigned long long> b;
  array<unsigned long long,3> c;
  a.resize(A);
  b.resize(B);
  
  unsigned long long min_a=pow(10,5);
  unsigned long long min_b=min_a;
  unsigned long long sum_min = 0;
  
  for(unsigned long long i=0;i<A;++i){
  	unsigned long long x;
    cin>>x;
    if(x<min_a)
      min_a = x;
    a.emplace_back(x);
  }
  cout<<endl;
  
   for(unsigned long long i=0;i<B;++i){
  	unsigned long long x;
    cin>>x;
    if(x<min_b)
      min_b = x;
    b.emplace_back(x);
  }
  cout<<endl;
  
  min_sum = min_a+min_b;
  for(unsigned long long j =0;j<M;++j){
  for(int i=0;i<3;++i){
  	cin>>c[i];
  }
    unsigned long long x = a[c[0]-1] + b[c[1]-1] - c[2];
    if(x<min_sum)
      min_sum = x;
  cout<<endl;
  }
  
 cout<<min_sum<<endl;
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:10:3: error: 'vector' was not declared in this scope
   10 |   vector<unsigned long long> a;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:10:10: error: expected primary-expression before 'unsigned'
   10 |   vector<unsigned long long> a;
      |          ^~~~~~~~
a.cc:11:10: error: expected primary-expression before 'unsigned'
   11 |   vector<unsigned long long> b;
      |          ^~~~~~~~
a.cc:12:31: error: aggregate 'std::array<long long unsigned int, 3> c' has incomplete type and cannot be defined
   12 |   array<unsigned long long,3> c;
      |                               ^
a.cc:2:1: note: 'std::array' is defined in header '<array>'; this is probably fixable by adding '#include <array>'
    1 | #include <iostream>
  +++ |+#include <array>
    2 | 
a.cc:13:3: error: 'a' was not declared in this scope
   13 |   a.resize(A);
      |   ^
a.cc:14:3: error: 'b' was not declared in this scope
   14 |   b.resize(B);
      |   ^
a.cc:16:28: error: 'pow' was not declared in this scope
   16 |   unsigned long long min_a=pow(10,5);
      |                            ^~~
a.cc:38:3: error: 'min_sum' was not declared in this scope; did you mean 'min_b'?
   38 |   min_sum = min_a+min_b;
      |   ^~~~~~~
      |   min_b
Language: C

#include<stdio.h>
#include<string.h>

int main(void){
  int i=0;
  int rei = 0;
  int densi = 0;
  int m = 0;
  scanf("%d", &rei);
  scanf("%d", &densi);
  scanf("%d", &m);
  int rprice[rei];
  int dprice[densi];
  int waribiki[rei][densi];
  int a;
  int b;
  int c;
  for(i=0;i<rei;i++){
    scanf("%d", &rprice[i]);
    //printf("%d", rprice[i]);
  }
  for(i=0;i<densi;i++){
    scanf("%d", &dprice[i]);
    //printf("%d", dprice[i]);
  }
  int j = 0;
  for(i=0;i<rei;i++){
    for(j=0;j<densi;j++){
      waribiki[i][j] = 0;
    }
  }
  for(i=0;i<m;i++){
    scanf("%d", &a);
    scanf("%d", &b);
    scanf("%d", &c);
    //printf("%d", a);
    //printf("%d", b);
    //printf("%d", c);
    if(waribiki[a-1][b-1] < c){
    	waribiki[a-1][b-1] = c;
    }
  }
  int min = 100000;
  int p = 0;
  for(i=0;i<rei;i++){
    for(j=0;j<densi;j++){
      //printf("%d", waribiki[i][j]);
      p = 0
      //printf("%d", p);
      if(p < min){
        min = p;    
      }
    }
  }
  printf("%d", min);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:48:12: error: expected ';' before 'if'
   48 |       p = 0
      |            ^
      |            ;
   49 |       //printf("%d", p);
   50 |       if(p < min){
      |       ~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;


int main(){
    int A,B,M;
    cin >> A >> B >> M;
    int mv=1000000;
    int x[A],y[B],c[M][3];
    for(int i = 0; i<A; i++) cin >> x[i];
    for(int i = 0; i<B; i++) cin >> y[i];
    for(int i = 0; i<M; i++) {
        cin >> c[i][0]>> c[i][1]>>c[i][2];
    }

    // for(int i = 0; i< A; i++){
    //     for(int j = 0; j<B; j++){
    //         mv=min(mv,x[i]+y[j]);
    //     } 
    // }
    for(int i = 0; i<M;i++){
        mv=min(mv,x[c[i][0]-1]+y[c[i][1]-1]-c[i][2]);
    }

    sort(x,x+A);sort(y,y+B);
    mv=min(mv,x[0]+y[0]);



    cout << mv<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   29 |     sort(x,x+A);sort(y,y+B);
      |     ^~~~
      |     sqrt