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

#include <iostream>
#include <algorithm>

using namespace std;

int main(){
  int n[3];
  cin >> n[0] >> n[1] >> n[2];
  
  cout << n[0]+n[1]+n[2]-max(n[0],n[1],n[2]) << endl;
  return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:10:29:   required from here
   10 |   cout << n[0]+n[1]+n[2]-max(n[0],n[1],n[2]) << endl;
      |                          ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C

#include <stdio.h>

int main(void){
	int a,sum=0,max=0;
	for(int i=0;i<3;i++){
		scanf("%d",&a);
		if(max<a) max=a;
		sum+=a;
	}
	print("%d\n",sum-max)
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   10 |         print("%d\n",sum-max)
      |         ^~~~~
      |         printf
main.c:10:30: error: expected ';' before '}' token
   10 |         print("%d\n",sum-max)
      |                              ^
      |                              ;
   11 | }
      | ~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
  size_t P, Q, R;
  cin >> P >> Q >> R;
  vector<size_t> v{P, Q, R};

  sort(v.begin(), v.end());

  cout << v[0] + v[1] << endl;

  return 0;
}

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

#include<iostream>
using namespace std;
int main(){
  int p,q,r,sum=0;
  cin >> p >> q >> r;
  if(a>b&&a>c) sum = b+c;
  else if(b>c&&b>a) sum=a+c;
  else sum= a+b;
  cout << sum << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: 'a' was not declared in this scope
    6 |   if(a>b&&a>c) sum = b+c;
      |      ^
a.cc:6:8: error: 'b' was not declared in this scope
    6 |   if(a>b&&a>c) sum = b+c;
      |        ^
a.cc:6:13: error: 'c' was not declared in this scope
    6 |   if(a>b&&a>c) sum = b+c;
      |             ^
Language: C++

#include <iostream>
#include <vector>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;

int main() {
  vector<int> v(3);
  cin >> v[0] >> v[1] >> v[2];
  sort(v.begin(), v.end());
  cout << v[0] + v[1];
  return 0;
}

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

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

int main() {
int a,b,c;
  cin >> a >> >> b >> c ;
  cout << min(min(a+b,b+c),c+a) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: expected primary-expression before '>>' token
    6 |   cin >> a >> >> b >> c ;
      |               ^~
Language: C++

//Keep working hard :)
#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long

const int N = 1e5+5;
int a[N];

void fileIO()
{
        #ifndef ONLINE_JUDGE
        freopen("int.txt","r",stdin);
        freopen("out.txt","w",stdout);
        #endif
}
int main()
{
	IOS;
    //fileIO();
    int a,b,c;
    cin >> a >> b >> c;
    cout << min(a+b,b+c,c+a);
	return 0;
}


Compiler output:
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:2:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:24:16:   required from here
   24 |     cout << min(a+b,b+c,c+a);
      |             ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int p,q,r;
    cin>>p>>q>>r;
    int min=p+q;
    if(min>p+r) min=p+r;
    if(min>q+r) min=q+r;
    cout<<min;
}


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

#include <stdio.h>

int main(void){
	int a,sum=0,max=0;
	for(int i=0;i<n;i++){
		scanf("%d",&a);
		if(max<a) max=a;
		sum+=a;
	}
	print("%d\n",sum-max)
}

Compiler output:
main.c: In function 'main':
main.c:5:23: error: 'n' undeclared (first use in this function)
    5 |         for(int i=0;i<n;i++){
      |                       ^
main.c:5:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:9: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   10 |         print("%d\n",sum-max)
      |         ^~~~~
      |         printf
main.c:10:30: error: expected ';' before '}' token
   10 |         print("%d\n",sum-max)
      |                              ^
      |                              ;
   11 | }
      | ~
Language: C++

#include  <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define P pair<int,int>
#define inf 1000000007
//P pa(114,514);   ,vector<P>vec(N,0);
//vector<vector<int>> vec(縦, vector<int>(横));
#define REP(i,N) for(int i=0;i<N;i++)
int gcd(int a, int b) {
    if(a>b){
        swap(a,b);
        }
    while(b%a!=0){
        b%=a;
        swap(a,b);
    }
    return a;
}
//cout << setprecision(123);
int main(){
  int P,Q,R;
  cin>>P>>Q>>R;
  cout<<P+Q+R-max({P,Q,R})<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:8: error: invalid declarator before ',' token
   22 |   int P,Q,R;
      |        ^
a.cc:23:9: error: expected primary-expression before '>>' token
   23 |   cin>>P>>Q>>R;
      |         ^~
a.cc:24:10: error: expected primary-expression before '+' token
   24 |   cout<<P+Q+R-max({P,Q,R})<<endl;
      |          ^
a.cc:24:21: error: expected primary-expression before ',' token
   24 |   cout<<P+Q+R-max({P,Q,R})<<endl;
      |                     ^
a.cc:24:18: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   24 |   cout<<P+Q+R-max({P,Q,R})<<endl;
      |               ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: Java

import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] t = new int[3];
        t[0] = sc.nextInt();
        t[1] = sc.nextInt();
        t[2] = sc.nextInt();
        Arrays.sort(t);
        Sysetm.out.println(t[0]+t[1]);
    }
}

Compiler output:
Main.java:10: error: package Sysetm does not exist
        Sysetm.out.println(t[0]+t[1]);
              ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[3];
	for (int i=0;i<n;i++)
		cn>>a[i];
	sort(a,a+n);
	cout<<a[0]+a[1]; 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: 'n' was not declared in this scope
    6 |         for (int i=0;i<n;i++)
      |                        ^
a.cc:7:17: error: 'cn' was not declared in this scope; did you mean 'yn'?
    7 |                 cn>>a[i];
      |                 ^~
      |                 yn
a.cc:8:18: error: 'n' was not declared in this scope
    8 |         sort(a,a+n);
      |                  ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>

using namespace std;

int main()
{
    int P, Q, R;
    cin >> P >> Q >> R;
    cout << min(min(P + Q, Q + R), R + P)
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:42: error: expected ';' before 'return'
   13 |     cout << min(min(P + Q, Q + R), R + P)
      |                                          ^
      |                                          ;
   14 |     return 0;
      |     ~~~~~~
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <utility> 
#include <tuple>
#include <iterator>
#include <functional>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)




void solve(){
  int p,q,r;
  cin >> p >> q >> r;
  int a ;
  a = max(max(p,q), r)
  cout << p+q+r-a << endl;
}

int main(){
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:20:23: error: expected ';' before 'cout'
   20 |   a = max(max(p,q), r)
      |                       ^
      |                       ;
   21 |   cout << p+q+r-a << endl;
      |   ~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

	#ifndef ONLINE_JUDGE
	#include <fileio.h>
	#endif

	int p, q, r; cin >> p >> q >> r;
	cout << min(min(p + q, q + r), r + p) << endl;
}

Compiler output:
a.cc:10:18: fatal error: fileio.h: No such file or directory
   10 |         #include <fileio.h>
      |                  ^~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
	int p,q,r;
    cin >> P >> q >> r;
    cout << min(min(p+q,q+r),p+r) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'P' was not declared in this scope
    6 |     cin >> P >> q >> r;
      |            ^
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <utility> 
#include <tuple>
#include <iterator>
#include <functional>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)




void solve(){
  int p,q,r
  cin >> p >> q >> r;
  int a ;
  a = max(max(p,q), r)
  cout << p+q+r-a << endl;
}

int main(){
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:18:3: error: expected initializer before 'cin'
   18 |   cin >> p >> q >> r;
      |   ^~~
a.cc:20:21: error: 'r' was not declared in this scope
   20 |   a = max(max(p,q), r)
      |                     ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

signed main() {
  int p, q, r; cin >> p >> q >> r;
  int madt;
  maxt = max({p, q, r})

  cout << (p+q+r) - maxt << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'maxt' was not declared in this scope; did you mean 'madt'?
    8 |   maxt = max({p, q, r})
      |   ^~~~
      |   madt
Language: C++

#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define lli long long int
#define ulli unsigned long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(lli i=a;i<b;i++)
#define initialize(array,size,value) for(lli i=0;i<size;i++) array[i]=value
#define couta(array,size) for(lli i=0;i<size;i++) cout<<array[i]<<" "
#define vl vector<lli>
#define vp vector< pair <lli,lli> >
#define sl set<lli>
#define msp multiset < pair < long long , long long > > S;
#define pll pair<lli, lli>
#define mll map<lli, lli>            //for( map<lli, lli>::iterator i=temp.begin();i!=temp.end();i++)cout<<i->fi<<" "<<i->se<<endl;
#define mvl map<lli, vl>
#define umll unordered_map<lli, lli>
#define vt vector<pair<lli, pll >  >
#define vf vector<pair<pll,pll > >
#define qu queue<lli>
#define pq priority_queue<lli>
#define dq deque <lli>
#define ptr vector<lli>::iterator
#define bs(array,x) binary_search(array.begin(),array.end(),x) // also valid for set and multiset
#define lb(array,x) lower_bound(array.begin(),array.end(),x)
#define ub(array,x) upper_bound(array.begin(),array.end(),x)
#define nobw(array,i,j) upper_bound(array.begin(), array.end(), j)-lower_bound(array.begin(), array.end(), i) //number of numbers between i & j
#define vc clear()
#define endl '\n'
#define sp system("pause");
#define INF 9223372036854775807
#define MINF -9223372036854775808
typedef tree<pll,null_type,less<pll>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
//string binary = bitset<32>(n).to_string(); 
int main()
{
 	ios::sync_with_stdio(0);
    cin.tie(0);
   
    vl a;
    for(lli i=0;i<3;i++){
    	lli x;
    	cin>>x;
    	a.pb(x);
    }
    sort(a.begin(),a.end());
    cout<<a[0]+a[1];


]
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:1: error: expected primary-expression before ']' token
   56 | ]
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	cout<<min(min((a+b),(b+c),(c+a))<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:41: error: invalid operands of types 'const int' and '<unresolved overloaded function type>' to binary 'operator<<'
    6 |         cout<<min(min((a+b),(b+c),(c+a))<<endl;
      |                   ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
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: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:6:15:   required from here
    6 |         cout<<min(min((a+b),(b+c),(c+a))<<endl;
      |                   ~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#import<bits/stdc++.h>
using namespace std;
int a,b,c,i,j,k,m,n,s;
main()
{
scanf("%d%d%d",&a,&b,&c);
printf("%d",a+b+c-(a>b?a>c?a:c:b>c?b:c);
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<bits/stdc++.h>
      |  ^~~~~~
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:40: error: expected ')' before ';' token
    7 | printf("%d",a+b+c-(a>b?a>c?a:c:b>c?b:c);
      |       ~                                ^
      |                                        )
Language: C++

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

int P, Q, R;

int main() {
    cin >> P >> Q >> R;
    int sum = P + Q + R;
    int min = min(P, min(Q, R));

    cout << sum - min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: 'min' cannot be used as a function
    9 |     int min = min(P, min(Q, R));
      |                      ~~~^~~~~~
a.cc:9:31: error: 'min' cannot be used as a function
    9 |     int min = min(P, min(Q, R));
      |                               ^
Language: C++

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

int main() {
  int P,Q,R;
  cin >> P >> Q >> R;
  cout << P+Q+R-max(P,Q,R) << endl;
}


Compiler output:
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:7:20:   required from here
    7 |   cout << P+Q+R-max(P,Q,R) << endl;
      |                 ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <utility> 
#include <tuple>
#include <iterator>
#include <functional>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)




void solve(){
  cin >> p >> q >> r;
  int a ;
  a = max(max(p,q), r)
  cout << p+q+r-a << endl;
}

int main(){
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:17:10: error: 'p' was not declared in this scope
   17 |   cin >> p >> q >> r;
      |          ^
a.cc:17:15: error: 'q' was not declared in this scope
   17 |   cin >> p >> q >> r;
      |               ^
a.cc:17:20: error: 'r' was not declared in this scope
   17 |   cin >> p >> q >> r;
      |                    ^
Language: C++

#include "bits/stdc++.h"

namespace std;

int main(){
  int a, b, c;
  cin >> a>>b>>c;
  cout<<a+b+c-max(a,max(b,c))<<endl;
  return 0;
}

Compiler output:
a.cc:3:14: error: expected '{' before ';' token
    3 | namespace std;
      |              ^
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> a>>b>>c;
      |   ^~~
      |   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:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout<<a+b+c-max(a,max(b,c))<<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:8:21: error: 'max' was not declared in this scope; did you mean 'std::max'?
    8 |   cout<<a+b+c-max(a,max(b,c))<<endl;
      |                     ^~~
      |                     std::max
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:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:8:15: error: 'max' was not declared in this scope; did you mean 'std::max'?
    8 |   cout<<a+b+c-max(a,max(b,c))<<endl;
      |               ^~~
      |               std::max
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:8:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |   cout<<a+b+c-max(a,max(b,c))<<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)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define ROR(i,a,b) for(ll i=a;i>=b;i--)
#define pb push_back
#define F first
#define S second
#define sz size()
#define mp make_pair
#define p(x) cout<< x << " ";
#define pe(x) cout<< x << endl ;
typedef long long ll;
const ll N = 1e5 + 5;
#define M 1000000007

int main()
{
    FAST
    ll a,b,c;
    cin>>a>>b>>c;
    ll sum=a+b+c;
    ll ma=max(a,max(b,c));
    sum=sum-ma;
    cout<<Sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: 'Sum' was not declared in this scope; did you mean 'sum'?
   25 |     cout<<Sum;
      |           ^~~
      |           sum
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  int p,q,r;
  cin >> p >> q >> r;
  cout << min(p + q, q + r, r + p) << endl;
}

Compiler output:
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: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:7:14:   required from here
    7 |   cout << min(p + q, q + r, r + p) << endl;
      |           ~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

@A=sort{$b<=>$a}glob<>;
print$A[1]+$A[2]

Compiler output:
a.cc:1:1: error: stray '@' in program
    1 | @A=sort{$b<=>$a}glob<>;
      | ^
a.cc:1:2: error: 'A' does not name a type
    1 | @A=sort{$b<=>$a}glob<>;
      |  ^
a.cc:1:17: error: 'glob' does not name a type
    1 | @A=sort{$b<=>$a}glob<>;
      |                 ^~~~
a.cc:2:1: error: 'print$A' does not name a type
    2 | print$A[1]+$A[2]
      | ^~~~~~~
Language: C++

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

int main() {
  int a,b,c; cin >> a >> b >> c;
  cout << min(a+b,b+c,c+a) << endl;

  return 0;
}

Compiler output:
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: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:6:14:   required from here
    6 |   cout << min(a+b,b+c,c+a) << endl;
      |           ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: Java

#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF ((long long)1e18)
#define MOD ((int)1e9+7)
#define endl "\n"

#define yn(f) ((f)?"Yes":"No")
#define YN(f) ((f)?"YES":"NO")

#define MAX

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int A, B, C;
	
	cin>>A>>B>>C;
	
	cout<<min(min(A+B, B+C), C+A)<<endl;
	
	
	return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include<string>
^
Main.java:3: error: illegal character: '#'
#include<iomanip>
^
Main.java:4: error: illegal character: '#'
#include<cmath>
^
Main.java:5: error: illegal character: '#'
#include<vector>
^
Main.java:6: error: illegal character: '#'
#include<algorithm>
^
Main.java:10: error: illegal character: '#'
#define int long long
^
Main.java:10: error: class, interface, enum, or record expected
#define int long long
        ^
Main.java:11: error: illegal character: '#'
#define rep(i,n) for(int i = 0; i < (n); i++)
^
Main.java:11: error: class, interface, enum, or record expected
#define rep(i,n) for(int i = 0; i < (n); i++)
                                ^
Main.java:11: error: class, interface, enum, or record expected
#define rep(i,n) for(int i = 0; i < (n); i++)
                                         ^
Main.java:12: error: illegal character: '#'
#define INF ((long long)1e18)
^
Main.java:13: error: illegal character: '#'
#define MOD ((int)1e9+7)
^
Main.java:14: error: illegal character: '#'
#define endl "\n"
^
Main.java:16: error: illegal character: '#'
#define yn(f) ((f)?"Yes":"No")
^
Main.java:17: error: illegal character: '#'
#define YN(f) ((f)?"YES":"NO")
^
Main.java:19: error: illegal character: '#'
#define MAX
^
Main.java:23: error: class, interface, enum, or record expected
	ios::sync_with_stdio(false);
	^
Main.java:24: error: class, interface, enum, or record expected
	cout<<fixed<<setprecision(10);
	^
Main.java:26: error: class, interface, enum, or record expected
	int A, B, C;
	^
Main.java:28: error: class, interface, enum, or record expected
	cin>>A>>B>>C;
	^
Main.java:30: error: class, interface, enum, or record expected
	cout<<min(min(A+B, B+C), C+A)<<endl;
	^
Main.java:33: error: class, interface, enum, or record expected
	return 0;
	^
Main.java:34: error: class, interface, enum, or record expected
}
^
24 errors
Language: C++

#include  <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define P pair<int,int>
#define inf 1000000007
//P pa(114,514);   ,vector<P>vec(N,0);
//vector<vector<int>> vec(縦, vector<int>(横));
#define REP(i,N) for(int i=0;i<N;i++)
int gcd(int a, int b) {
    if(a>b){
        swap(a,b);
        }
    while(b%a!=0){
        b%=a;
        swap(a,b);
    }
    return a;
}
//cout << setprecision(123);
int main(){
  int P,Q,R;
  cin>>P>>Q>>R;
  cout<<P+Q+R-max{P,Q,R}<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:8: error: invalid declarator before ',' token
   22 |   int P,Q,R;
      |        ^
a.cc:23:9: error: expected primary-expression before '>>' token
   23 |   cin>>P>>Q>>R;
      |         ^~
a.cc:24:10: error: expected primary-expression before '+' token
   24 |   cout<<P+Q+R-max{P,Q,R}<<endl;
      |          ^
a.cc:24:25: error: expected primary-expression before '<<' token
   24 |   cout<<P+Q+R-max{P,Q,R}<<endl;
      |                         ^~
Language: C++

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

int main() {
  int p, q, r;
  cin >> p >> q >> r;
  cout << min({p+q, q+r, r+p}) endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:31: error: expected ';' before 'endl'
    7 |   cout << min({p+q, q+r, r+p}) endl;
      |                               ^~~~~
      |                               ;
Language: C++

#include <bits/stdc++.h>
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 (a>b) { a=b; return 1; } return 0; }
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()

int main(){
    int a[3];
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+n);
    cout<<a[0]+a[1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: 'n' was not declared in this scope
   17 |     sort(a,a+n);
      |              ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep1(i,n) for(int i=1; i<=(n); ++i)
#define repi(i,a,b) for(int i=a; i<=(b); ++i)
#define rrep(i,n) for(int i=(n-1); i>=0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define pb push_back
#define mp make_pair
#define to_s to_string
#define sz(v) (int)v.size()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define pr(x) cout<<(x)<<'\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
#define yes "Yes"
#define no "No"
using namespace std;
using ll = long long;
using Edge = pair<int,long long>;
using Graph = vector<vector<Edge>>;
typedef pair<int,int> P;
struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}aaaaaaa;
int MOD = 1e9 + 7;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int P,Q,R;
int main(){
    cin >>P >>Q>>R;
    cout << min(P+Q,min(Q+R,R+P)) << endl;
}

Compiler output:
a.cc:29:5: error: 'int P' redeclared as different kind of entity
   29 | int P,Q,R;
      |     ^
a.cc:21:23: note: previous declaration 'typedef struct std::pair<int, int> P'
   21 | typedef pair<int,int> P;
      |                       ^
a.cc: In function 'int main()':
a.cc:31:13: error: expected primary-expression before '>>' token
   31 |     cin >>P >>Q>>R;
      |             ^~
a.cc:32:18: error: expected primary-expression before '+' token
   32 |     cout << min(P+Q,min(Q+R,R+P)) << endl;
      |                  ^
a.cc:32:32: error: expected primary-expression before ')' token
   32 |     cout << min(P+Q,min(Q+R,R+P)) << endl;
      |                                ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
const ll INF = 1e9 + 7;
using namespace std;
typedef long long ll;

map<ll, int> mp;
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	vector<int> p(3);
	cin >> p[0] >> p[1] >> p[2];
	sort(p.begin(), p.end());
	cout << p[0] + p[1] << endl;
	return 0;
}

Compiler output:
a.cc:17:7: error: 'll' does not name a type
   17 | const ll INF = 1e9 + 7;
      |       ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
//define
#define int long long
#define rep(x,y) for(int i=x;i<y;i++)
#define REP(x,y) for(int j=x;j<y;j++)
#define Rep(x,y) for(int k=x;k<y;k++)
#define str string
#define pb() push_back()
#define all(x) x.begin(),x.end()
#define elif else if
#define mod 100000007
//vectordefine
#define vint vector<int>
#define vvint vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vool vector<bool>
#define vtr vector<str>
#define vvtr vector<vector<str>>
//queuedefine
#define qint queue<int>
#define qtr queue<string>
#define qc queue<char>
//pairdefine
#define pint pair<int,int>
#define pic pair<int,char>
#define pci pair<char,int>
#define pis pair<int,str>
#define psi pair<str,int>
#define pcc pair<char,char>
#define pss pair<str,str>
#define mp make_pair
//mapdefine
#define mint map<int,int>
#define mic map<int,char>
#define mci map<char,int>
#define mis map<int,str>
#define msi map<str,int>
//function
str shizuku(char,char);
//UnionFind
struct UnionFind{
  vint par;
  UnionFind(int N):par(N){
    rep(0,N)par[i]=i;
  }
  int root(int x){
    if(par[x]==x)return x;
    return par[x]=root(par[x]);
  }
  void unite(int x,int y){
    int rx=root(x);
    int ry=root(y);
    if(rx==ry)return;
    par[rx]=ry;
  }
  bool same(int x,int y){
    return root(x)==root(y);
  }
};
//binary_search

//main
signed main(){
    int N=0,M,X,count=0,count2=0;
    double d,D;
    int alph='A'-'a';
    char op,Ch;
    str S,T;
    cin>>N>>M>>X;
    vtr W(N/2);vtr w(N/2);
    rep(0,N)cin>>W[i]>>w[i];
    cout<<min(A,B)+min(B,C)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:15: error: 'A' was not declared in this scope
   74 |     cout<<min(A,B)+min(B,C)<<endl;
      |               ^
a.cc:74:17: error: 'B' was not declared in this scope
   74 |     cout<<min(A,B)+min(B,C)<<endl;
      |                 ^
a.cc:74:26: error: 'C' was not declared in this scope
   74 |     cout<<min(A,B)+min(B,C)<<endl;
      |                          ^
Language: C++

#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
#define EPS (1e-5)
#define bit(n,k) ((n>>k)&1)
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H& b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H & b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H & b) const { return x == b.x && y == b.y; }
	bool operator!=(const H & b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P& b) const { return cost < b.cost; }
	bool operator>(const P& b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E& b) const { return cost < b.cost; }
	bool operator>(const E& b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T & a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T & a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j % i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int p, q, r;
signed main() {
	cin >> p >> q >> r;
	cout << p + q + r - max(p, q, r) << endl;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:99:25:   required from here
   99 |         cout << p + q + r - max(p, q, r) << endl;
      |                             ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

def main():
    li = LI()
    li.sort()
    ans = sum(li[:2])
    return ans

print(main())

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAX_N=1e6;
int seg_tree[2*MAX_N+5],n;
void build()
{
for(int i=n-1; i>0; --i)
seg_tree[i]=__gcd(seg_tree[i<<1],seg_tree[i<<1|1]);
}
void modify(int pos,int val)
{
for(seg_tree[pos+=n]=val; pos>1; pos>>=1)
seg_tree[pos>>1]=__gcd(seg_tree[pos],seg_tree[pos^1]);
}
int query(int l,int r)
{
int ans(1);
for(l+=n,r+=n; l<r; l>>=1,r>>=1)
{
if(l&1)
ans=__gcd(ans,seg_tree[l++]);
if(r&1)
ans=__gcd(ans,seg_tree[--r]);
}
return ans;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
int sum(0);
long long int arr[n];
for(int i=0; i<n; ++i)
{
cin>>arr[i];
sum+=arr[i];
}
int sum1(0),as(10000);
for(int i=0; i<n; ++i)
{
sum1+=arr[i];
as=min(as,abs(sum1-(sum-sum1));
}
cout<<as;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:31: error: expected ')' before ';' token
   45 | as=min(as,abs(sum1-(sum-sum1));
      |       ~                       ^
      |                               )
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAX_N=1e6;
int seg_tree[2*MAX_N+5],n;
void build()
{
for(int i=n-1; i>0; --i)
seg_tree[i]=__gcd(seg_tree[i<<1],seg_tree[i<<1|1]);
}
void modify(int pos,int val)
{
for(seg_tree[pos+=n]=val; pos>1; pos>>=1)
seg_tree[pos>>1]=__gcd(seg_tree[pos],seg_tree[pos^1]);
}
int query(int l,int r)
{
int ans(1);
for(l+=n,r+=n; l<r; l>>=1,r>>=1)
{
if(l&1)
ans=__gcd(ans,seg_tree[l++]);
if(r&1)
ans=__gcd(ans,seg_tree[--r]);
}
return ans;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
long long int arr[n];
for(int i=0; i<n; ++i)
{
cin>>arr[i];
sum+=arr[i]; 
}
int sum1(0),as(10000);
for(int i=0; i<n; ++i)
{
sum1+=arr[i];
as=min(as,abs(sum1-(sum-sum1));
}
cout<<as;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:1: error: 'sum' was not declared in this scope
   38 | sum+=arr[i];
      | ^~~
a.cc:44:21: error: 'sum' was not declared in this scope; did you mean 'sum1'?
   44 | as=min(as,abs(sum1-(sum-sum1));
      |                     ^~~
      |                     sum1
Language: C++

int main()
{
	int n;
	std::cin >> n;

	int *w = (int *)malloc(sizeof(int) * n);

	int sum = 0;
	for (int i = 0; i < n; i++) {
		std::cin >> w[i];
	}

	for (int i = 0; i < n; i++) {
		sum += w[i];
	}
	int sum_all = sum;
	int target = sum / 2;

	int index = 0;
	int def = sum;
	
	while (1) {
		sum -= w[index];
		if (sum < target) {
			if (!(target - sum < def)) {
				sum += w[index];
			}
			break;
		}
		def = sum - target;
		index++;
	}

	std::cout << sum_all - sum << std::endl;
	free(w);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: 'cin' is not a member of 'std'
    4 |         std::cin >> n;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main()
a.cc:6:25: error: 'malloc' was not declared in this scope
    6 |         int *w = (int *)malloc(sizeof(int) * n);
      |                         ^~~~~~
a.cc:1:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
  +++ |+#include <cstdlib>
    1 | int main()
a.cc:10:22: error: 'cin' is not a member of 'std'
   10 |                 std::cin >> w[i];
      |                      ^~~
a.cc:10:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:14: error: 'cout' is not a member of 'std'
   34 |         std::cout << sum_all - sum << std::endl;
      |              ^~~~
a.cc:34:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:44: error: 'endl' is not a member of 'std'
   34 |         std::cout << sum_all - sum << std::endl;
      |                                            ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main()
a.cc:35:9: error: 'free' was not declared in this scope
   35 |         free(w);
      |         ^~~~
a.cc:35:9: note: 'free' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
Language: C++

int main()
{
	int n;
	std::cin >> n;

	int *w = (int *)malloc(sizeof(int) * n);

	int sum = 0;
	for (int i = 0; i < n; i++) {
		std::cin >> w[i];
	}

	for (int i = 0; i < n; i++) {
		sum += w[i];
	}

	int target = sum / 2;

	int index = 0;
	int def = sum;
	
	while (1) {
		sum -= w[index];
		if (sum < target) {
			if (!(target - sum < def)) {
				index--;
			}
			break;
		}
		def = sum - target;
		index++;
	}

	std::cout << index << std::endl;
	free(w);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: 'cin' is not a member of 'std'
    4 |         std::cin >> n;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main()
a.cc:6:25: error: 'malloc' was not declared in this scope
    6 |         int *w = (int *)malloc(sizeof(int) * n);
      |                         ^~~~~~
a.cc:1:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
  +++ |+#include <cstdlib>
    1 | int main()
a.cc:10:22: error: 'cin' is not a member of 'std'
   10 |                 std::cin >> w[i];
      |                      ^~~
a.cc:10:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:14: error: 'cout' is not a member of 'std'
   34 |         std::cout << index << std::endl;
      |              ^~~~
a.cc:34:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:36: error: 'endl' is not a member of 'std'
   34 |         std::cout << index << std::endl;
      |                                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main()
a.cc:35:9: error: 'free' was not declared in this scope
   35 |         free(w);
      |         ^~~~
a.cc:35:9: note: 'free' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N; cin>>N;
  vector<int> W(N); 
  int S=0;
  for(int i=0; i<N; i++){
    cin>>W[i];
    S+=W[i];
  }
  int L=0; int Ans=10001
  for(int i=0; i<N; i++){
    L+=W[i]; S-=W[i];
    if(abs(L-S)<Ans)
      Ans=abs(L-S);
  }
  cout<<Ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected ',' or ';' before 'for'
   12 |   for(int i=0; i<N; i++){
      |   ^~~
a.cc:12:16: error: 'i' was not declared in this scope
   12 |   for(int i=0; i<N; i++){
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main()
{
  int n;
  cin >> n;
  
  int w[n];
  rep(i,n){cin >> w[i];}
  
  int sum1 = 0;
  int sum2 = 0;
  int ans = 1e9;
  rep(i,n){
    rep(j,n){
      if(j <= i){
        sum1 += w[j];
      }else{
        sum2 += w[j];
      }
    }
    if(abs(sum1 - sum2) < ans){
      ans = abs(sum1 - sum2);
    }
    sum1 = 0;
    sum2 = 0;
  }
  
  cout << ans << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:30:23: error: expected '}' at end of input
   30 |   cout << ans << endl;
      |                       ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

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

int main(){
  int N  ;
  cin >> N ;
  vector<int> W(N);
  for(int i = 0; i < N; i++) cin >> W[i];
  vector<int> XW(N + 1);
  for(int i = 1; i <= N; i++) XW[i] = XW[i - 1] + X[i - 1];
  int ans = 1LL << 60;
  for(int i = 1; i < N;) ans = min(ans, XW[N] - XW[i]);
  
  cout << ans;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:51: error: 'X' was not declared in this scope
   10 |   for(int i = 1; i <= N; i++) XW[i] = XW[i - 1] + X[i - 1];
      |                                                   ^
a.cc:11:17: warning: overflow in conversion from 'long long int' to 'int' changes value from '1152921504606846976' to '0' [-Woverflow]
   11 |   int ans = 1LL << 60;
      |             ~~~~^~~~~
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> omori = new ArrayList<Integer>();
		int n = sc.nextInt();
		for (int i = 0; i <= n - 1; i++) {
			int a = sc.nextInt();
			omori.add(a);
		}
		int weight = 0;
		for (int i = 0; i <= n - 1; i++) {
			weight += omori.get(i);
		}

		for (int i = 0; i < n - 1; i++) {
			int zen = 0;
			for (int j = 0; j <= i; j++) {
				zen += omori.get(j);
			}
			int kou = weight - zen;

			int zen2 = zen + omori.get(i + 1);
			int kou2 = weight - zen2;

			ans = Math.min(Math.abs(zen2 - kou2), Math.abs(zen - kou));

		}
		System.out.println(ans);

	}
}


Compiler output:
Main.java:28: error: cannot find symbol
			ans = Math.min(Math.abs(zen2 - kou2), Math.abs(zen - kou));
			^
  symbol:   variable ans
  location: class Main
Main.java:31: error: cannot find symbol
		System.out.println(ans);
		                   ^
  symbol:   variable ans
  location: class Main
2 errors
Language: C++

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

int main(){
  int N;cin>>N;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin>>vec.at(i);
  }
  int min,sum;
  sum=accumulate(vec.begin(),vec.end(),0);
  for(int i=0;i<N;i++){
    if(i==0){
      min=abs(sum-vec.at(0)*2);
    }
    else{
      int absl;
      absl=abs(vec.substr(0,vec.at(i))-vec.substr(vec.at(i+1),N));
      if(absl<min){
        min=absl;
      }
    }
  }
  cout<<absl<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: 'class std::vector<int>' has no member named 'substr'
   18 |       absl=abs(vec.substr(0,vec.at(i))-vec.substr(vec.at(i+1),N));
      |                    ^~~~~~
a.cc:18:44: error: 'class std::vector<int>' has no member named 'substr'
   18 |       absl=abs(vec.substr(0,vec.at(i))-vec.substr(vec.at(i+1),N));
      |                                            ^~~~~~
a.cc:24:9: error: 'absl' was not declared in this scope; did you mean 'fabsl'?
   24 |   cout<<absl<<endl;
      |         ^~~~
      |         fabsl
Language: C++

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

int main(){
  int N;cin>>N;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin>>vec.at(i);
  }
  int min,sum;
  sum=accumulate(vec.begin(),vec.end(),0);
  for(int i=0;i<N;i++){
    if(i==0){
      min=abs(sum-vec.at(0)*2);
    }
    else{
      int absl:
      absl=abs(vec.substr(0,vec.at(i))-vec.substr(vec.at(i+1),N));
      if(absl<min){
        min=absl;
      }
    }
  }
  cout<<absl<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: found ':' in nested-name-specifier, expected '::'
   17 |       int absl:
      |               ^
      |               ::
a.cc:17:11: error: 'absl' has not been declared
   17 |       int absl:
      |           ^~~~
a.cc:18:11: error: qualified-id in declaration before '=' token
   18 |       absl=abs(vec.substr(0,vec.at(i))-vec.substr(vec.at(i+1),N));
      |           ^
a.cc:19:10: error: 'absl' was not declared in this scope; did you mean 'fabsl'?
   19 |       if(absl<min){
      |          ^~~~
      |          fabsl
a.cc:24:9: error: 'absl' was not declared in this scope; did you mean 'fabsl'?
   24 |   cout<<absl<<endl;
      |         ^~~~
      |         fabsl