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

#include <iostream>
using namespace std;

int main() {
  // 整数の入力
  int A, B, M;
  cin >> A >> B >> M;
  // 配列の用意
  int refrigerator[A], microwave[B], coupon[M];
  
  for (int i = 0; i < A; i++) {
    cin >> refrigerator[i];  // 冷蔵庫
  }

  int min_price = INT_MAX;
  for (int j = 0; j < B; j++) {
    cin >> microwave[j];  // 電子レンジ
    for (int i = 0; i < A; i++) {
      int price = refrigerator[i] + microwave[j];
      if (price < min_price) {
        min_price = price;
      }
    }
  }

  int x, y, c;
  for (int k = 0; k < M; k++) {
    cin >> x >> y >> c;
    int price = refrigerator[x-1] + refrigerator[y-1] - c;
    if (price < min_price) {
      min_price = price;
    }
  }
  
  // 出力
  cout << min_price << endl;
  return 0;
}

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

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


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

   int a,b,m;
   cin >> a >> b >> m;
   vector<int> A(a);
   vector<int> B(b);
   rep(i,0,a) cin >> A[i];
   rep(i,0,b) cin >> B[i];
   sort(A.rbegin(),A.rend());
   sort(B.rbegin(),B.rend());
   int minA = min_element(A.begin(),A.end());
   int minB = min_element(B.begin(),B.end());
   int ans = minA+minB;
   rep(i,0,m){
     int x,y,c;
     cin >> x >> y >> c; x--; y--;
     ans=min(ans,A[x]+B[y]-c);
   }
   cout << ans << endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   18 |    int minA = min_element(A.begin(),A.end());
      |               ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
      |                          |
      |                          __gnu_cxx::__normal_iterator<int*, std::vector<int> >
a.cc:19:26: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   19 |    int minB = min_element(B.begin(),B.end());
      |               ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
      |                          |
      |                          __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

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

int main()
{
  int a, b, m;
  cin >> a >> b >> m;

  valarray<int> re(a);
  for (auto&& e : re) cin >> e;

  valarray<int> mw(b);
  for (auto&& e : mw) cin >> e;

  valarray<int> ans(m);
  for (auto&& e : ans) {
    int x, y, c;
    cin >> x >> y >> c;
    e = re[x - 1] + mw[y - 1] - c;
  }
  ans.push_back(re.min() + mw.min());

  cout << ans.min() << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:7: error: 'class std::valarray<int>' has no member named 'push_back'
   21 |   ans.push_back(re.min() + mw.min());
      |       ^~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <unordered_map>
#include <limits>

using namespace std;
int main(){

  int A,B,M;
  cin >> A >> B >> M;
  vector<int> av(A);
  vector<int> bv(B);

  for(int i=0; i<A; i++){
    int a;
    cin >> a;
    av[i]=a;
  }
  for(int i=0; i<B; i++){
    int b;
    cin >> b;
    bv[i]=b;
  }

  std::vector< unordered_map<string,int> > coupons;
  for(int i=0; i<M; i++){
    cin >> coupons[i]["x"] >> coupons[i]["y"] >> coupons[i]["c"];
  }

  int min = numeric_limits<int>::max();
  for(unordered_map<string,int> coupon : coupons){
    int payment = av[coupon["x"]] + bv[coupon["y"]] - coupon["c"];
    if(payment < min){
      min = payment;
    }
  }
  cout << min;


Compiler output:
a.cc: In function 'int main()':
a.cc:37:15: error: expected '}' at end of input
   37 |   cout << min;
      |               ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

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

int main() {
  int A, B, M;
  cin >> A >> B >> M;
  
  vector<int> a(A), b(B);
  
  for (int i = 0; i < A; i++) cin >> a.at(i);

//  int minA = *min_element(a.begin(), a.end());
  int minA = a.at(0);
  for (int i = 0; i < A; i++) {
    if (a.at(i) < minA) {
      minA = a.at(i);
    }
  }
    
  for (int j = 0; j <B; j++) cin >> b.at(j);

  int minB = min_element(b.begin(), b.end());  
//  int minB = b.at(0);
//  for (int j = 0; j < B; j++) {
//    if (j < minB) {
//      minB = b.at(j);
//    }
//  }
  
  int minAB = minA + minB; 
  
  vector<int> x(M), y(M), c(M);
  
  for (int k = 0; k < M; k++) {  
  cin >> x.at(k) >> y.at(k) >> c.at(k);
  }
  
  int minm = a.at(x.at(0) - 1) + b.at(y.at(0) - 1) - c.at(0);

  for (int k = 0; k < M; k++) {
    if (a.at(x.at(k) - 1) + b.at(y.at(k) - 1) - c.at(k) < minm) {
      minm = a.at(x.at(k) - 1) + b.at(y.at(k) - 1) - c.at(k);
    }  
  }

  cout << min(minAB, minm) << endl;
}


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

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

int main() {
  int A, B, M;
  cin >> A >> B >> M;
  
  vector<int> a(A), b(B);
  
  for (int i = 0; i < A; i++) cin >> a.at(i);

//  int minA = *min_element(a.begin(), a.end());
  int minA = A.at(0);
  for (int i = 0; i < A; i++) {
    if (i < minA) {
      minA = a.at(i);
    }
  }
    
  for (int j = 0; j <B; j++) cin >> b.at(j);

  int minB = *min_element(b.begin(), b.end());  
//  int minB = b.at(0);
//  for (int j = 0; j < B; j++) {
//    if (j < minB) {
//      minB = b.at(j);
//    }
//  }
  
  int minAB = minA + minB; 
  
  vector<int> x(M), y(M), c(M);
  
  for (int k = 0; k < M; k++) {  
  cin >> x.at(k) >> y.at(k) >> c.at(k);
  }
  
  int minm = a.at(x.at(0) - 1) + b.at(y.at(0) - 1) - c.at(0);

  for (int k = 0; k < M; k++) {
    if (a.at(x.at(k) - 1) + b.at(y.at(k) - 1) - c.at(k) < minm) {
      minm = a.at(x.at(k) - 1) + b.at(y.at(k) - 1) - c.at(k);
    }  
  }

  cout << min(minAB, minm) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: request for member 'at' in 'A', which is of non-class type 'int'
   13 |   int minA = A.at(0);
      |                ^~
Language: C++

// solv_B.cpp : 
//

#define _CRT_SECURE_NO_WARNINGS

#include <vector>
#include <map>
#include <cstdio>

using namespace std;


int main()
{
    int i, j, k;
    int x, y, c;

    int A, B, M;
    scanf("%d %d %d", &A, &B, &M);

    int* prices_A = new int[A];
    int* prices_B = new int[B];

    for (i = 0; i < A; i++) {
        scanf("%d", &prices_A[i]);
    }
    for (i = 0; i < B; i++) {
        scanf("%d", &prices_B[i]);
    }

    map<int, int> dc;
    int idx;

    for (i = 0; i < M; i++) {
        scanf("%d %d %d", &x, &y, &c);

        idx = (x - 1) * B + (y - 1);
        if (dc[idx] < c) {
            dc[idx] = c;
        }
    }

    int min_p = prices_A[0] + prices_B[0];
    int p;
    int* prices_B_dc = new int[B];

    for (i = 0; i < A; i++) {
        idx = i * B;

        for (j = 0; j < B; j++) {
            prices_B_dc[j] = prices_B[j] - dc[idx + j];
        }
        qsort(prices_B_dc, (size_t)B, sizeof(int), [](const void* a, const void* b) {
            return *(int*)a - *(int*)b;
            }
        );

        p = prices_A[i] + prices_B_dc[0];

        if (p < min_p) {
            min_p = p;
        }
    }

    printf("%d\n",min_p); 
    fflush(stdout);
    

    delete[] prices_A, prices_B;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:9: error: 'qsort' was not declared in this scope
   53 |         qsort(prices_B_dc, (size_t)B, sizeof(int), [](const void* a, const void* b) {
      |         ^~~~~
Language: C++

#include<algorithm>
#include<vector>
#include<iostream>
 
using namespace std;
 
int main(void){
  int a,b,m;
  vector<int> oven,fridge;
  vector<vector<int>> ticket;
  
  cin >> a >> b >> m;
  
  oven.resize(a);
  fridge.resize(b);
  ticket.resize(m);
  
  for(int i=0;i<oven.size();i++) cin >> oven[i];
  for(int i=0;i<fridge.size();i++) cin >> fridge[i];
  for(int i=0;i<ticket.size();i++){
    vector<int> t(3);
    cin >> t[0];
    cin >> t[1];
    cin >> t[2];
    ticket[i]=t;
  }
  
  int money=-1;
  for(int i=0;i<ticket.size();i++){
    int tmp_money=oven[ticket[i][0]]+fridge[ticket[i][1]]-ticket[2];
    if(money<0||money>tmp_money) money=tmp_money;
  }
  
  sort(oven.begin(),oven.end());
  sort(fridge.begin(),fridge.end());
  
  int no_ticket_money=oven[0]+fridge[0];
  
  if(no_ticket_money<money) money=no_ticket_money;
  
  std::cout << money;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:58: error: no match for 'operator-' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'})
   30 |     int tmp_money=oven[ticket[i][0]]+fridge[ticket[i][1]]-ticket[2];
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:30:67: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   30 |     int tmp_money=oven[ticket[i][0]]+fridge[ticket[i][1]]-ticket[2];
      |                                                                   ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:30:67: note:   mismatched types 'const std::move_iterator<_IteratorL>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   30 |     int tmp_money=oven[ticket[i][0]]+fridge[ticket[i][1]]-ticket[2];
      |                                                                   ^
Language: C++

#include<iostream>
#include<algorithm>

using namespace std;

int main(void){
  int a,b,m;
  vector<int> oven,fridge;
  vector<vector<int>> ticket;
  
  cin >> a >> b >> m;
  
  oven.resize(a);
  fridge.resize(b);
  ticket.resize(m);
  
  for(int i=0;i<oven.size();i++) cin >> oven[i];
  for(int i=0;i<fridge.size();i++) cin >> fridge[i];
  for(int i=0;i<ticket.size();i++){
    vector<int> t(3);
    cin >> t[0];
    cin >> t[1];
    cin >> t[2];
    ticket[i]=t;
  }
  
  int money=-1;
  for(int i=0;i<ticket.size();i++){
    int tmp_money=oven[ticket[i][0]]+fridge[ticket[i][1]]-ticket[2];
    if(money<0||money>tmp_money) money=tmp_money;
  }
  
  sort(oven.begin(),oven.end());
  sort(fridge.begin(),fridge.end());
  
  int no_ticket_money=oven[0]+fridge[0];
  
  if(no_ticket_money<money) money=no_ticket_money;
  
  return money;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> oven,fridge;
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include<algorithm>
  +++ |+#include <vector>
    3 | 
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> oven,fridge;
      |          ^~~
a.cc:9:17: error: expected primary-expression before 'int'
    9 |   vector<vector<int>> ticket;
      |                 ^~~
a.cc:13:3: error: 'oven' was not declared in this scope
   13 |   oven.resize(a);
      |   ^~~~
a.cc:14:3: error: 'fridge' was not declared in this scope; did you mean 'fwide'?
   14 |   fridge.resize(b);
      |   ^~~~~~
      |   fwide
a.cc:15:3: error: 'ticket' was not declared in this scope
   15 |   ticket.resize(m);
      |   ^~~~~~
a.cc:20:12: error: expected primary-expression before 'int'
   20 |     vector<int> t(3);
      |            ^~~
a.cc:21:12: error: 't' was not declared in this scope
   21 |     cin >> t[0];
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
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];
  }
  for(int i=0;i<m;i++)
  {
    cin>>x[i]>>y[i]>>c[i];
  }
  int min=A[x[0]]+B[y[0]]-c[0];
  
  for(int i=1;i<m;i++)
  {
    if(min>A[x[i]]+B[y[i]]-c[i])
      min=A[x[i]]+B[y[i]]-c[i];
  }
  
  for(int i=0;i<a;i++)
  {
    for(int j=0;j<b;j++)
    {
      if(min>A[i]+B[j])
        min=A[i]+B[j];
    }
  }
  
  cout<<min;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: 'x' was not declared in this scope
   22 |     cin>>x[i]>>y[i]>>c[i];
      |          ^
a.cc:22:16: error: 'y' was not declared in this scope
   22 |     cin>>x[i]>>y[i]>>c[i];
      |                ^
a.cc:22:22: error: 'c' was not declared in this scope
   22 |     cin>>x[i]>>y[i]>>c[i];
      |                      ^
a.cc:24:13: error: 'x' was not declared in this scope
   24 |   int min=A[x[0]]+B[y[0]]-c[0];
      |             ^
a.cc:24:21: error: 'y' was not declared in this scope
   24 |   int min=A[x[0]]+B[y[0]]-c[0];
      |                     ^
a.cc:24:27: error: 'c' was not declared in this scope
   24 |   int min=A[x[0]]+B[y[0]]-c[0];
      |                           ^
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;


int main(){
  int na,nb,nm;
  cin >> na >> nb >> nm;
  vector <int> a;
  rep(i,na){
    int t;
    cin>>t;
    a.push_back(t);
  }
  vector <int> b;
  rep(i,nb){
    int s;
    cin>>s;
    b.push_back(s);
  }
  vector <int> m;
  rep(i,nm){
    int xa,xb,c,ans;
    cin>>xa>>xb>>c;
    ans =a.at(xa)+b.at(xb)-c ;
    m.push_back(ans);
  }
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  auto itra =a.begin();
  auto itrb =b.begin();
  int an = *itra +*itrb;

  sort(m.begin(),m.end());
  auto itrm = m.begin();
  int anm = *itrm;
  int ansans = min(anm,an);
  cout<<ansans<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:40:22: error: expected '}' at end of input
   40 |   cout<<ansans<<endl;
      |                      ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
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 (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
    int A, B;
    int M;
    cin >> A >> B >> M;
    vi a(A);
    vi b(B);
    vi x(M);
    vi y(M);
    vi c(M);
    rep(i, A){
        cin >> a.at(i);
    }
    rep(i, B){
        cin >> b.at(i);
    }
    rep(i, M){
        cin >> x.at(i) >> y.at(i) >> c.at(i);
    }

    int min = INF;
    int discount;
    rep(i, A){
        rep(j, B){
            rep(k, M){
                discount = 0;
                if(i = x.at(k) && j = y.at(k)){
                    discount = c.at(i);
                }
                if(min > a.at(i) + b.at(j) - discount){
                    min = a.at(i) + b.at(j) - discount;
                }
            }
        }
    }
    cout << min;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:32: error: lvalue required as left operand of assignment
   72 |                 if(i = x.at(k) && j = y.at(k)){
      |                        ~~~~~~~~^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
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 (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
    int A, B;
    int M;
    cin >> A >> B >> M;
    vi a(A);
    vi b(B);
    vi x(M);
    vi y(M);
    vi c(M);
    rep(i, A){
        cin >> a.at(i);
    }
    rep(i, B){
        cin >> b.at(i);
    }
    rep(i, M){
        cin >> x.at(i) >> y.at(i) >> c.at(i);
    }

    int min = INF;
    int discount;
    rep(i, A){
        rep(j, B){
            rep(k, M){
                discount = 0;
                if(i = x.at(k) && j = y.at(k)){
                    discount = c.at(i);
                }
                if(min > a.at(i) + b.at(j) - discount){
                    min = a.at(i) + b.at(j) - discount;
                }
            }
        }
    }
    cout min;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:32: error: lvalue required as left operand of assignment
   72 |                 if(i = x.at(k) && j = y.at(k)){
      |                        ~~~~~~~~^~~~
a.cc:81:9: error: expected ';' before 'min'
   81 |     cout min;
      |         ^~~~
      |         ;
Language: C

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#define REP(i,n) for(int i;i<(int)n;i++)
#
using namespace std;

int main(){
  int A,B,M;
  cin>>A>>B>>M;
  vector <int> vec1(A);
  vector <int> vec2(B);
  REP(i,A) {cin>>vec1[i];}
  REP(i,B) {cin>>vec2[i];}
  int minA=*min_element(vec1.begin(),vec1.end());
  int minB=*min_element(vec2.begin(),vec2.end());
  int ans=minA+minB;
  REP(i,M){
    int x,y,c;
    cin>>x>>y>>c;
    x--;y--;
    ans=min(ans,vec1[x]+vec2[y]-c);
  }
  cout<<ans<<endl;
  return 0;

}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#定義
costA = []
costB = []

# ロジック
A,B,M = map(int,input().split()) # A(冷蔵庫)の種類、B(電子レンジ)の種類、M(割引券)の数
x = [[] for i in range(M)]
y = [[] for i in range(M)]
c = [[] for i in range(M)]
costA = input().split()
costB = input().split()
for i in range(M):
  x[i],y[i],c[i] = map(int,input().split()) # x[i]=割引できるA(冷蔵庫)の種類、
                                            # y[i]=割引できるB(電子レンジ)の種類、
                                            # c[i]=割引額
mincostA = int(costA[0])
for j in range(A):
  if int(costA[j]) < mincostA:
    mincostA = int(costA[j])

mincostB = int(costB[0])
for k in range(B):
  if int(costB[k]) < mincostB:
    mincostB = int(costB[k])

teika = mincostA + mincostB

for l in range(M):
  ind1 = x[l] - 1
  out1 = int(costA[ind1]) 
  ind2 = y[l] - 1
  out2 = int(costB[ind2])
  if (out1 + out2 - int(c[l])) < teika:
    teika = (out1 + out2 - int(c[l]))

print(teika)


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #\U00005b9a\U00007fa9
    1 | #定義
      |  ^~~~
a.cc:5:3: error: invalid preprocessing directive #\U000030ed\U000030b8\U000030c3\U000030af
    5 | # ロジック
      |   ^~~~~~~~
a.cc:6:34: error: stray '#' in program
    6 | A,B,M = map(int,input().split()) # A(冷蔵庫)の種類、B(電子レンジ)の種類、M(割引券)の数
      |                                  ^
a.cc:6:45: error: extended character 、 is not valid in an identifier
    6 | A,B,M = map(int,input().split()) # A(冷蔵庫)の種類、B(電子レンジ)の種類、M(割引券)の数
      |                                             ^
a.cc:6:66: error: extended character 、 is not valid in an identifier
    6 | A,B,M = map(int,input().split()) # A(冷蔵庫)の種類、B(電子レンジ)の種類、M(割引券)の数
      |                                                                  ^
a.cc:13:45: error: stray '#' in program
   13 |   x[i],y[i],c[i] = map(int,input().split()) # x[i]=割引できるA(冷蔵庫)の種類、
      |                                             ^
a.cc:13:71: error: extended character 、 is not valid in an identifier
   13 |   x[i],y[i],c[i] = map(int,input().split()) # x[i]=割引できるA(冷蔵庫)の種類、
      |                                                                       ^
a.cc:14:47: error: invalid preprocessing directive #y
   14 |                                             # y[i]=割引できるB(電子レンジ)の種類、
      |                                               ^
a.cc:14:75: error: extended character 、 is not valid in an identifier
   14 |                                             # y[i]=割引できるB(電子レンジ)の種類、
      |                                                                           ^
a.cc:15:47: error: invalid preprocessing directive #c
   15 |                                             # c[i]=割引額
      |                                               ^
a.cc:2:1: error: 'costA' does not name a type
    2 | costA = []
      | ^~~~~
Language: C++

#include<bits/stdc++.h>
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];
  int mina,minb;
  mina=*min_element(a.begin(),a,end());
  minb=*min_element(b.begin(),b.end());
  int ans=mina+minb;
  for(int i=0;i<M;i++){
    int a1,b1,discount;
    cin>>a1>>b1>>discount;
    ans=min(ans,a[a1]+b[b1]-discount);
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:36: error: no matching function for call to 'end()'
   10 |   mina=*min_element(a.begin(),a,end());
      |                                 ~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1265:5: note:   candidate expects 1 argument, 0 provided
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int a,b,m;
  cin >> a >> b >> m;
  int aa[a], bb[b], c[m], x[m], y[m], all[m+1];
  for(int i=0; i<a; i++) cin >> aa[i];
  for(int i=0; i<b; i++) cin >> bb[i];
  for(int i=0; i<m; i++){
    cin >> x[i] >> y[i] >> c[i];
    d[i] = aa[x[i]] + bb[y[i]] - c[i];
  }
  sort(aa, aa+a);
  sort(bb, bb+b);
  d[m] = aa[0] + bb[0];
  sort(d, d+m+1);
  cout << d[0];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'd' was not declared in this scope
   12 |     d[i] = aa[x[i]] + bb[y[i]] - c[i];
      |     ^
a.cc:16:3: error: 'd' was not declared in this scope
   16 |   d[m] = aa[0] + bb[0];
      |   ^
Language: C++

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

int main() {
  int A, B, M;
  std::cin >> A >> B >> M;
  std::vector<int> a(A);
  std::vector<int> b(B);
  for (int i = 0; i < A; i++) {
    std::cin >> a.at(i);
  }
  for (int i = 0; i < B; i++) {
    std::cin >> b.at(i);
  }
  int a_min = *std::min_element(a.begin(), a.end());
  int b_min = *std::min_element(b.begin(), b.end());
  int min_cost = a_min + b_min;
  for (int i = 0; i < M; i++) {
    int x, y, c;
    std::cin >> x >> y >> c;
    x--;
    y--;
    min_cost = std::min(min_cost, a[x] + b[y] - c);
  }
  std::cout << min_cost << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'?
   16 |   int a_min = *std::min_element(a.begin(), a.end());
      |                     ^~~~~~~~~~~
      |                     tuple_element
a.cc:17:21: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'?
   17 |   int b_min = *std::min_element(b.begin(), b.end());
      |                     ^~~~~~~~~~~
      |                     tuple_element
Language: C++

#include<iostream>
#include<climits>
using namespace std;
const int N = 1e6;
int x[N], y[N];
int main(){
	int a,b,m; cin >> a >> b >> m;
    int minv = INT_MAX, minv2 = INT_MAX;
    for (int i = 0; i < a; i ++) {
    	cin >> x[i];
        minv = min(minv, x[i]);
    }
    for (int i = 0; i < b; i ++) {
    	cin >> y[i];
        minv = min(minv, y[i]);
    }
    int temp_min = minv + minv2;
    for (int i = 0; i < a; i ++) {
    	int q,w,e; cin >> q >> w >> e;
        temp_min = min(temp_min, (a[q] + b[w] - e));
    }
    cout << temp_min;
    return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:36: error: invalid types 'int[int]' for array subscript
   20 |         temp_min = min(temp_min, (a[q] + b[w] - e));
      |                                    ^
a.cc:20:43: error: invalid types 'int[int]' for array subscript
   20 |         temp_min = min(temp_min, (a[q] + b[w] - e));
      |                                           ^
Language: C++

#include<iostream>
using namespace std;
const int N = 1e6;
int x[N], y[N];
int main(){
	int a,b,m; cin >> a >> b >> m;
    int minv = INT_MAX, minv2 = INT_MAX;
    for (int i = 0; i < a; i ++) {
    	cin >> x[i];
        minv = min(minv, x[i]);
    }
    for (int i = 0; i < b; i ++) {
    	cin >> y[i];
        minv = min(minv, y[i]);
    }
    int temp_min = minv + minv2;
    for (int i = 0; i < a; i ++) {
    	int q,w,e; cin >> q >> w >> e;
        temp_min = min(temp_min, (a[q] + b[w] - e));
    }
    cout << temp_min;
    return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'INT_MAX' was not declared in this scope
    7 |     int minv = INT_MAX, minv2 = INT_MAX;
      |                ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | using namespace std;
a.cc:16:27: error: 'minv2' was not declared in this scope; did you mean 'minv'?
   16 |     int temp_min = minv + minv2;
      |                           ^~~~~
      |                           minv
a.cc:19:36: error: invalid types 'int[int]' for array subscript
   19 |         temp_min = min(temp_min, (a[q] + b[w] - e));
      |                                    ^
a.cc:19:43: error: invalid types 'int[int]' for array subscript
   19 |         temp_min = min(temp_min, (a[q] + b[w] - e));
      |                                           ^
Language: C++

#include<iostream>
using namespace std;
const int N = 1e6;
int x[N], y[N]
int main(){
	int a,b,m; cin >> a >> b >> m;
    int minv = INT_MAX, minv2 = INT_MAX;
    for (int i = 0; i < a; i ++) {
    	cin >> x[i];
        minv = min(minv, x[i]);
    }
    for (int i = 0; i < b; i ++) {
    	cin >> y[i];
        minv = min(minv, y[i]);
    }
    int temp_min = minv + minv2;
    for (int i = 0; i < a; i ++) {
    	int q,w,e; cin >> q >> w >> e;
        temp_min = min(temp_min, (a[q] + b[w] - e));
    }
    cout << temp_min;
    return 0;
    
}

Compiler output:
a.cc:5:1: error: expected initializer before 'int'
    5 | int main(){
      | ^~~
Language: C++

#include<iostream>

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];
	int minA = *min_element(a.begin(), a.end());
	int minB = *min_element(b.begin(), b.end());
	int ans = minA+minB;
	for (int i = 0; i < M; i++) {
		int x, y, c;
		cin >> x >> y >> c; x--; y--;
		ans = min(ans, a[x] + b[y] - c);
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<int> a(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:7:16: error: expected primary-expression before 'int'
    7 |         vector<int> a(A);
      |                ^~~
a.cc:8:16: error: expected primary-expression before 'int'
    8 |         vector<int> b(B);
      |                ^~~
a.cc:9:43: error: 'a' was not declared in this scope
    9 |         for (int i = 0; i < A; i++)cin >> a[i];
      |                                           ^
a.cc:10:43: error: 'b' was not declared in this scope
   10 |         for (int i = 0; i < B; i++)cin >> b[i];
      |                                           ^
a.cc:11:33: error: 'a' was not declared in this scope
   11 |         int minA = *min_element(a.begin(), a.end());
      |                                 ^
a.cc:11:21: error: 'min_element' was not declared in this scope
   11 |         int minA = *min_element(a.begin(), a.end());
      |                     ^~~~~~~~~~~
a.cc:12:33: error: 'b' was not declared in this scope
   12 |         int minB = *min_element(b.begin(), b.end());
      |                                 ^
Language: C++

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

int main() {
    int a,b,m;
    cin >> a >> b >> m;
    int s[a],t[b];
    for(int i=0;i<a;i++) cin >> s[i];
    for(int i=0;i<b;i++) cin >> t[i];
    int ans=1e9;
    int x,y,c;
    for(int i=0;i<m;i++){
        cin >> x >> y >> c;
        ans=min(ans,s[x-1]+t[y-1]-c);
    }
    sort(s.begin(),s.end());
    sort(t.begin(),t.end());
    ans=min(ans,s[0]+t[0]);
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: request for member 'begin' in 's', which is of non-class type 'int [a]'
   16 |     sort(s.begin(),s.end());
      |            ^~~~~
a.cc:16:22: error: request for member 'end' in 's', which is of non-class type 'int [a]'
   16 |     sort(s.begin(),s.end());
      |                      ^~~
a.cc:17:12: error: request for member 'begin' in 't', which is of non-class type 'int [b]'
   17 |     sort(t.begin(),t.end());
      |            ^~~~~
a.cc:17:22: error: request for member 'end' in 't', which is of non-class type 'int [b]'
   17 |     sort(t.begin(),t.end());
      |                      ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
  	int A, B, M, x, y, c;
  	cin >> A >> B >> M;
  	vector<int> a(A);
  	vector<int> b(B);
  	int min_a = min_b = -1;
  	for (int i=0; i<A; i++) {
    	cin >> a[i];
      	min_a = min(min_a, a[i]);
    }
    for (int i=0; i<B; i++) {
    	cin >> b[i];
      	min_b = min(min_b, b[i]);
    }
  	int ans = min_a + min_b;
  	for (int i=0; i<M; i++) {
    	cin >> x >> y >> c;
      	ans = min(ans, a[x-1]+a[y-1]-c);
    }
  	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: 'min_b' was not declared in this scope; did you mean 'min_a'?
   10 |         int min_a = min_b = -1;
      |                     ^~~~~
      |                     min_a
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
const LL mod=1000000007;
const LL LINF=1LL<<60;
const int INF=1<<30;
int dx[]={1,0,-1,0,1,-1,1,-1};
int dy[]={0,1,0,-1,1,-1,-1,1};


int main(){
    int A,B,M;cin >> A >> B >> M;
    vector<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];
    }
    int ans = INF;
    for (int i = 0; i < m; i++) {
        int x,y,c;cin >> x >> y >> c;
        x--,y--;
        chmin(ans, a[x] + b[y] - c);
    }
    sort(ALL(a));
    sort(ALL(b));
    chmin(ans, a[0] + b[0]);
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:25: error: 'm' was not declared in this scope
   32 |     for (int i = 0; i < m; i++) {
      |                         ^
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

import sun.util.resources.Bundles;

public class Main {
	public static void main(String[] args){
		InputStreamReader in = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(in);
//		Scanner sc = new Scanner(System.in);
		int[] line = parseIntArray(br.readLine());
//		int aSpeceis = line[0];
//		int bSpeceis = line[1];
		int m = line[2];
		int[] aPrices = parseIntArray(br.readLine());
		int[] bPrices = parseIntArray(br.readLine());
		
		int[][] discount = new int[m][3];
		for(int i=0;i<m;i++) {
			String d = br.readLine();
			discount[i] = parseIntArray(d);
		}
		br.close();
		
		List<Integer> payment = new ArrayList<Integer>();
		for(int i=0;i<m;i++) {
			payment.add(aPrices[discount[i][0]-1]+bPrices[discount[i][1]-1]-discount[i][2]);
		}
		// 割引なしの合計最安
		int minA = 100000;
		int minB = 100000;
		for(int i: aPrices) {
			if(minA > i) {
				minA = i;
			}
		}
		for(int i: bPrices) {
			if(minB > i) {
				minB = i;
			}
		}
		payment.add(minA+minB);
		
		int minPayment = 200000;
		for(Integer i: payment) {
			if(minPayment > i) {
				minPayment = i;
			}
		}
		
		System.out.print(minPayment);
	}
	
	private static int[] parseIntArray(String line) {
		String[] arr = line.split(" ");
		int [] intArr = new int[arr.length];
		for(int i=0;i<arr.length;i++) {
			intArr[i] = Integer.parseInt(arr[i]);
		}
		return intArr;
	}
}

Compiler output:
Main.java:5: error: package sun.util.resources is not visible
import sun.util.resources.Bundles;
               ^
  (package sun.util.resources is declared in module java.base, which does not export it to the unnamed module)
1 error
Language: C

#include<stdio.h>
int main(void){
  int i,a,b,m;
  scanf("%d%d%d",&a,&b,&m);
  int den[b],rei[a],wari[m][3];
  for(i=0;i<a;i++){
    scanf("%d",&rei[i]);
  }
  for(i=0;i<b;i++){
    scanf("%d",&den[i]);
  }
  for(i=0;i<m;i++){
    scanf("%d%d%d",&wari[i][0],&wari[i][1],&wari[i][2]);
  }
  int min=10000,j;
  for(i=0;i<m;i++){
    if(min>(rei[wari[i][0]-1]+den[wari[i][1]-1]-wari[i][2])){
      min=(rei[wari[i][0]-1]+den[wari[i][1]-1]-wari[i][2]);
    }
    for(i=0;i<a;i++){
      for(j=0;j<b;j++){
        if(min>rei[i]+den[j]) min=rei[i]+den[j];
      }}
    printf("%d",min);
    return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:26:3: error: expected declaration or statement at end of input
   26 |   }
      |   ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int main(){
	int a, b, m;
	cin >> a >> b >> m;
	vector<int> na;
	vector<int> nb;
	for(int i = 0; i < a; ++i){
		int x; cin >> x;
		na.push_back(x);
	}
	for(int i = 0; i < b; ++i){
		int x; cin >> x;
		nb.push_back(x);
	}
	ll minnum = 1e9 + 7;
	for(int i = 0; i < m; ++i){
		int x, y, c;
		cin >> x >> y >> c;
		int sum = na[x - 1] + nb[y - 1] - c;
		if(sum < minnum) minnum = sum;
	}
	sort(na.begin(), na.end());
	sort(nb.begin(), nb.end());
	if(na[0] + nb[0] < minnum) minnum = na[0] + nb[0];
	cout << minnum << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   25 |         sort(na.begin(), na.end());
      |         ^~~~
      |         short
Language: C++

#include<bits/stdc++.h>
#define ll long long int
#define mod 1000000007
using namespace std;
ll power(ll x,ll n)
{
	ll res =1;
	while(n>0)
	{
		if(n%2==1)
	res=res*x;
	x=x*x;
	n=n/2;
	}
	return res;
	
}

int main(){

ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n,m,k,i;
    cin>>n>>m>>k;
    int a[n],b[m];
    for(i=0;i<n;i++)
    cin>>a[i];
    for(i=0;i<m;i++)
    cin>>b[i];
    set<ll>s;
    while(k--)
    {
    	int x,y,c;
    	cin>>x>>y>>c;
    	s.insert(a[x-1]+b[y-1]-c);
    	
	}
    sort(a,a+n);
    sort(b,b+n);
    cout<<min(*s.begin(),a[0]+b[0]);
	
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:14: error: no matching function for call to 'min(const long long int&, int)'
   41 |     cout<<min(*s.begin(),a[0]+b[0]);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:41:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   41 |     cout<<min(*s.begin(),a[0]+b[0]);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:41:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   41 |     cout<<min(*s.begin(),a[0]+b[0]);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
2 using namespace std;
3 int main() {
4 intA,B,M;
5 cin>>A>>B>>M;
6 vector<int> a(A);
7 vector<int> b(B);
8 for(inti=0;i<A;i++)cin>>a[i];
9 for(inti=0;i<B;i++)cin>>b[i];
10 int minA = *min_element(a.begin(), a.end());
11 int minB = *min_element(b.begin(), b.end());
12 int ans = minA+minB;
13 for(inti=0;i<M;i++){
14 int x, y, c;
15 cin >> x >> y >> c; x--; y--;
16 ans = min(ans, a[x] + b[y] - c);
17 }
18 cout << ans << endl;
19 return 0;
20 }

Compiler output:
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2 using namespace std;
      | ^
a.cc:3:1: error: expected unqualified-id before numeric constant
    3 | 3 int main() {
      | ^
Language: C++

include<bits/stdc++.h>
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];
int minA= *min_element(a.begin(),a.end());
int minB= *min_element(b.begin(),b.end());i
int ans=minA+minB;13for(int i= 0;i<M;i++) 
{
int x,y,c;
cin>>x>>y>>c;
x--;y--;
ans=min(ans,a[x] +b[y] -c);
}
cout<<ans<<endl;
return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
    5 | cin>>A>>B>>M;
      | ^~~
a.cc:6:1: error: 'vector' was not declared in this scope
    6 | vector<int>a(A);
      | ^~~~~~
a.cc:6:8: error: expected primary-expression before 'int'
    6 | vector<int>a(A);
      |        ^~~
a.cc:7:8: error: expected primary-expression before 'int'
    7 | vector<int>b(B);
      |        ^~~
a.cc:9:6: error: 'a' was not declared in this scope
    9 | cin>>a[i];
      |      ^
a.cc:11:6: error: 'b' was not declared in this scope
   11 | cin>>b[i];
      |      ^
a.cc:12:24: error: 'a' was not declared in this scope
   12 | int minA= *min_element(a.begin(),a.end());
      |                        ^
a.cc:12:12: error: 'min_element' was not declared in this scope
   12 | int minA= *min_element(a.begin(),a.end());
      |            ^~~~~~~~~~~
a.cc:13:24: error: 'b' was not declared in this scope
   13 | int minB= *min_element(b.begin(),b.end());i
      |                        ^
a.cc:13:43: error: 'i' was not declared in this scope
   13 | int minB= *min_element(b.begin(),b.end());i
      |                                           ^
a.cc:14:19: error: unable to find numeric literal operator 'operator""for'
   14 | int ans=minA+minB;13for(int i= 0;i<M;i++)
      |                   ^~~~~
a.cc:14:25: error: expected primary-expression before 'int'
   14 | int ans=minA+minB;13for(int i= 0;i<M;i++)
      |                         ^~~
a.cc:21:1: error: 'cout' was not declared in this scope
   21 | cout<<ans<<endl;
      | ^~~~
a.cc:21:7: error: 'ans' was not declared in this scope
   21 | cout<<ans<<endl;
      |       ^~~
a.cc:21:12: error: 'endl' was not declared in this scope
   21 | cout<<ans<<endl;
      |            ^~~~
Language: C

#include<stdio.h>

int main(){
  int i,j,k,l;
  int A,B,M;
  scanf("%d %d %d",&A,&B,&M);
  int Al[A],Bl[B],D[M];
  int amin=100000,bmin=100000;
  for(i=0;i<A,i++){
    scanf("%d ",&Al[i]);
    if(Al[i] < amin)
      amin=Al[i];
  }
  for(i=0;i<B,i++){
    scanf("%d ",&Bl[i]);
    if(Bl[i] < amin)
      bmin=Bl[i];
  }
  
  int ans;
  
  ans = amin+bmin;
  
  for(i=0;i<M;i++){
    scanf("%d %d %d",&j,&k,&l);
    if(amin > (Al[j-1]+Bl[k-1]-l))
      ans = Al[j-1]+Bl[k-1]-l;
  }
  
  printf("%d\n",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:18: error: expected ';' before ')' token
    9 |   for(i=0;i<A,i++){
      |                  ^
      |                  ;
main.c:14:18: error: expected ';' before ')' token
   14 |   for(i=0;i<B,i++){
      |                  ^
      |                  ;
Language: C++

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

int main(){


int A,B,M;
cin>>A>>B>>M;


int amin=100000;
int bmin=100000;

int a[A],b[B];
int x[M],y[M],c[M];
int i,j,k,q,w;

for(i=0;i<A;++i){cin>>a[i];if(a[i]<amin)amin=a[i]};
for(j=0;j<B;++j){cin>>b[j];if(a[j]<bmin)bmin=b[j]}
for(k=0;k<M;++k)cin>>x[k]>>y[k]>>c[k];


int cost[M];
int f=amin+bmin;

for(int l=0;l<M;l++){

	w=x[l];
	q=y[l];
	cost[l]=a[w]+b[q]-c[l];
	if(cost[l]<f){f=cost[l];}
}

cout<<f<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:50: error: expected ';' before '}' token
   18 | for(i=0;i<A;++i){cin>>a[i];if(a[i]<amin)amin=a[i]};
      |                                                  ^
      |                                                  ;
a.cc:19:50: error: expected ';' before '}' token
   19 | for(j=0;j<B;++j){cin>>b[j];if(a[j]<bmin)bmin=b[j]}
      |                                                  ^
      |                                                  ;
Language: C++

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

int main(){


int A,B,M;
cin>>A>>B>>M;


int amin=100000;
int bmin=100000;

int a[A],b[B];
int x[M],y[M],c[M];
int i,j,k,q,w;

for(i=0;i<A;++i){cin>>a[i];if(a[i]<amin)amin=a[i]}
for(j=0;j<B;++j){cin>>b[j];if(a[j]<bmin)bmin=b[j]}
for(k=0;k<M;++k)cin>>x[k]>>y[k]>>c[k];


int cost[M];
int f=amin+bmin;

for(int l=0;l<M;l++){

	w=x[l];
	q=y[l];
	cost[l]=a[w]+b[q]-c[l];
	if(cost[l]<f){f=cost[l];}
}

cout<<f<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:50: error: expected ';' before '}' token
   18 | for(i=0;i<A;++i){cin>>a[i];if(a[i]<amin)amin=a[i]}
      |                                                  ^
      |                                                  ;
a.cc:19:50: error: expected ';' before '}' token
   19 | for(j=0;j<B;++j){cin>>b[j];if(a[j]<bmin)bmin=b[j]}
      |                                                  ^
      |                                                  ;