Language: C++

#include <bits/stdc++.h>

int main(){
  int a, b, m;
  cin >> a >> b >> m;
  vector<int> x(a), y(b);
  vector<int> u(m), v(m), c(m);
  for(auto&& t:x)cin >> t;
  for(auto&& t:y)cin >> t;
  for(int i=0;i<m;i++)
    cin >> u[i] >> v[i] >> c[i];
  int ans = 100000000;
  for(int i=0;i<m;i++){
    ans = min(x[u[i]] + y[v[i]] - c[i], ans);
  }
  sort(x.begin(), x.end());
  sort(y.begin(), y.end());
  cout << min(ans, x[0] + y[0]) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> a >> b >> m;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> x(a), y(b);
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> x(a), y(b);
      |          ^~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> u(m), v(m), c(m);
      |          ^~~
a.cc:8:16: error: 'x' was not declared in this scope
    8 |   for(auto&& t:x)cin >> t;
      |                ^
a.cc:9:16: error: 'y' was not declared in this scope
    9 |   for(auto&& t:y)cin >> t;
      |                ^
a.cc:11:12: error: 'u' was not declared in this scope
   11 |     cin >> u[i] >> v[i] >> c[i];
      |            ^
a.cc:11:20: error: 'v' was not declared in this scope
   11 |     cin >> u[i] >> v[i] >> c[i];
      |                    ^
a.cc:11:28: error: 'c' was not declared in this scope
   11 |     cin >> u[i] >> v[i] >> c[i];
      |                            ^
a.cc:14:15: error: 'x' was not declared in this scope
   14 |     ans = min(x[u[i]] + y[v[i]] - c[i], ans);
      |               ^
a.cc:14:17: error: 'u' was not declared in this scope
   14 |     ans = min(x[u[i]] + y[v[i]] - c[i], ans);
      |                 ^
a.cc:14:25: error: 'y' was not declared in this scope
   14 |     ans = min(x[u[i]] + y[v[i]] - c[i], ans);
      |                         ^
a.cc:14:27: error: 'v' was not declared in this scope
   14 |     ans = min(x[u[i]] + y[v[i]] - c[i], ans);
      |                           ^
a.cc:14:35: error: 'c' was not declared in this scope
   14 |     ans = min(x[u[i]] + y[v[i]] - c[i], ans);
      |                                   ^
a.cc:14:11: error: 'min' was not declared in this scope; did you mean 'std::min'?
   14 |     ans = min(x[u[i]] + y[v[i]] - c[i], ans);
      |           ^~~
      |           std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:16:8: error: 'x' was not declared in this scope
   16 |   sort(x.begin(), x.end());
      |        ^
a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   16 |   sort(x.begin(), x.end());
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:17:8: error: 'y' was not declared in this scope
   17 |   sort(y.begin(), y.end());
      |        ^
a.cc:18:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |   cout << min(ans, x[0] + y[0]) << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:11: error: 'min' was not declared in this scope; did you mean 'std::min'?
   18 |   cout << min(ans, x[0] + y[0]) << endl;
      |           ^~~
      |           std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:18:36: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |   cout << min(ans, x[0] + y[0]) << endl;
      |                                    ^~~~
      |                                    std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~