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

#include <iostream>
using namespace std;
 
int N;
int L[100];
 
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> L[i];
  
  int Lmax, S = 0;
  for (int i = 0; i < N; ++i) {
    if (L[i] >= Lmax) Lmax = L[i];
    S += L;
  }
  
  if (S <= Lmax) cout << "Yes" << endl;
  else cout << "No" << endl;
}
#include <iostream>
using namespace std;
 
int N;
int L[100];
 
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> L[i];
  
  int Lmax, S = 0;
  for (int i = 0; i < N; ++i) {
    if (L[i] >= Lmax) Lmax = L[i];
    S += L[i];
  }
  
  if (S <= Lmax) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   14 |     S += L;
      |     ~~^~~~
      |       |
      |       int*
a.cc: At global scope:
a.cc:23:5: error: redefinition of 'int N'
   23 | int N;
      |     ^
a.cc:4:5: note: 'int N' previously declared here
    4 | int N;
      |     ^
a.cc:24:5: error: redefinition of 'int L [100]'
   24 | int L[100];
      |     ^
a.cc:5:5: note: 'int L [100]' previously declared here
    5 | int L[100];
      |     ^
a.cc:26:5: error: redefinition of 'int main()'
   26 | int main() {
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main() {
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;
 
int N;
int L[100];
 
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> L[i];
  
  int Lmax, S = 0;
  for (int i = 0; i < N; ++i) {
    if (L[i] >= Lmax) Lmax = L[i];
    S += L;
  }
  
  if (S <= Lmax) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   14 |     S += L;
      |     ~~^~~~
      |       |
      |       int*
Language: C++

#include <iostream>
using namespace std;
 
int N;
int L[100];
 
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> L[i];
  
  int Lmax, S = 0;
  for (int i = 0; i < N; ++i) {
    if (L[i] >= Lmax) Lmax = L[i];
    S += L;
  }
  
  if (S <= Lmax) cout << "Yes" << endl;
  else cout << "No" << endl;
}
#include <iostream>
using namespace std;
 
int N;
int L[100];
 
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> L[i];
  
  int Lmax, S = 0;
  for (int i = 0; i < N; ++i) {
    if (L[i] >= Lmax) Lmax = L[i];
    S += L;
  }
  
  if (S <= Lmax) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   14 |     S += L;
      |     ~~^~~~
      |       |
      |       int*
a.cc: At global scope:
a.cc:23:5: error: redefinition of 'int N'
   23 | int N;
      |     ^
a.cc:4:5: note: 'int N' previously declared here
    4 | int N;
      |     ^
a.cc:24:5: error: redefinition of 'int L [100]'
   24 | int L[100];
      |     ^
a.cc:5:5: note: 'int L [100]' previously declared here
    5 | int L[100];
      |     ^
a.cc:26:5: error: redefinition of 'int main()'
   26 | int main() {
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main() {
      |     ^~~~
a.cc: In function 'int main()':
a.cc:33:7: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   33 |     S += L;
      |     ~~^~~~
      |       |
      |       int*
Language: C++

#include <iostream>
using namespace std;
 
int N;
int L[100];
 
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> L[i];
  
  int Lmax, S = 0;
  for (int i = 0; i < N; ++i) {
    if (L[i] >= L_max) Lmax = L[i];
    S += L;
  }
  
  if (S <= Lmax) : cout << "Yes" << endl;
  else : cout << "No" << endl;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'L_max' was not declared in this scope; did you mean 'Lmax'?
   13 |     if (L[i] >= L_max) Lmax = L[i];
      |                 ^~~~~
      |                 Lmax
a.cc:14:7: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   14 |     S += L;
      |     ~~^~~~
      |       |
      |       int*
a.cc:17:18: error: expected primary-expression before ':' token
   17 |   if (S <= Lmax) : cout << "Yes" << endl;
      |                  ^
a.cc:18:8: error: expected primary-expression before ':' token
   18 |   else : cout << "No" << endl;
      |        ^
a.cc:18:31: error: expected '}' at end of input
   18 |   else : cout << "No" << endl;
      |                               ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
// マクロ
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
// 型エイリアス
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using vvs = vector<vs>;

int main() {
    int n;
    cin >> n;
    vi l(n);
    rep(i,n) cin >> l[i];
    sort(l.rbegin(),l.rend());
    int sum = 0;
    for(int i = 1; i < n; i++) {
        sum += l[i];
    }
    if(l[0] < sum) cout << "Yes" << endl;
    else cout << "No" << endll
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:26: error: 'endll' was not declared in this scope
   23 |     else cout << "No" << endll
      |                          ^~~~~
Language: C++

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

int main(){
  int N;
  cin>>N;
  int line[N];
  int sum=0;
  
  for(int i=0;i<N;i++){
    cin>>line[i];
    sum+=line[i];
  }
  int hantei=0;
  
  for(int i=0;i<N;i++){
    if(sum-line[i]=<line[i]){
      hantei++;
    }
  }
  if(hantei==0){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: expected primary-expression before '<' token
   17 |     if(sum-line[i]=<line[i]){
      |                    ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>

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

    int sum = 0;
    int mmax = 0;
    for (int i = 0; i < N; i++) {
        std::cin >> m;
        sum += m;
        mmax = std::max(mmax, m);
    }

    std::cout << ((mmax < (sum-mmax)) ? "Yes" : "No") << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: 'm' was not declared in this scope
   13 |         std::cin >> m;
      |                     ^
Language: C++

#include<iostream>
using namepackage std;
int main(){
  int N;
  cin>>N;
 // int hen[N];
  int max=0;
  int sum=0;int a;
  for(int i=0;i<N;i++){
    cin>>a;
    sum+=a;
    if(max<a)max=a;
  }
  sum=sum-max;
  if(sum>max){
    cout<<"Yes";
  }else{
    cout<<"No";}
  return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namepackage'
    2 | using namepackage std;
      |       ^~~~~~~~~~~
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>>N;
      |   ^~~
      |   std::cin
In file included 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:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |     cout<<"Yes";
      |     ^~~~
      |     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:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |     cout<<"No";}
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.concurrent.ArrayBlockingQueue;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[] l = new int[n];
        for(int i=0;i<n;i++){
            l[i] = Integer.parseInt(sc.next());
        }
        sort(l, 0, n-1);
        int max = l[0];
        int sum = 0;
        for(int i=1;i<n;i++){
            sum += l[i];
        }
        if(max < sum){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}

Compiler output:
Main.java:14: error: cannot find symbol
        sort(l, 0, n-1);
        ^
  symbol:   method sort(int[],int,int)
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Main{[
	public static void main(String[]args){
		
		Scanner sc=new Scanner(System.in);
		
		int n=sc.nextInt();
	
		int l[]=new int[n];
		for(int i=0;i<n;i++){
			l[i]=sc.nextInt();
		}
		
		int max=0;
		int total=0;
		
		for(int i=0;i<n;i++){
			if(l[i]>max){
				max=l[i];
			}
			total+=l[i];
		}
		
		if(max<total-max){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
		
	}
}

Compiler output:
Main.java:3: error: illegal start of type
public class Main{[
                  ^
Main.java:3: error: ']' expected
public class Main{[
                   ^
2 errors
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
typedef long long ll;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod 1000000007

int main(){
	int N;
	vector<int> P(N);
	rep(i,n) cin >> P[i];
	sort(P.begin(),P.end());
	int sum = 0;
	bool aaa = false;
	for(int i = 0; i < N; i++){
		sum += P[i];
		if(sum > P[N-1] * 2){
			aaa = true;
		}
	}
	if(aaa){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: 'n' was not declared in this scope
   15 |         rep(i,n) cin >> P[i];
      |               ^
a.cc:9:45: note: in definition of macro 'rep'
    9 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                             ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const ll mod = 1000000007;
const ll INF = mod * mod;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
typedef vector<int> vec;
typedef vector<string> svec;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
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; }
//#define int long long

void solve() {
    int n; cin >> n;
    int l[20]; 
    int lmax = 0, lsun = 0;
    rep(i, n) {
        cin >> l[i];
        lsum += l[i];
        lmax = max(lmax, l[i]);
    }
    if(lmax < lsum - lmax) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:57:9: error: 'lsum' was not declared in this scope; did you mean 'lsun'?
   57 |         lsum += l[i];
      |         ^~~~
      |         lsun
a.cc:60:15: error: 'lsum' was not declared in this scope; did you mean 'lsun'?
   60 |     if(lmax < lsum - lmax) {
      |               ^~~~
      |               lsun
Language: C++

#include <stdio.h>
#include <iostream>

using namespace std;

#define REP(a, i, n) for (int i = a; i < n; ++i)

int main() {
    int N;
    cin >> N;

    int L[N];
    REP(0, i, N) {
        cin >> L[i];
    }

    sort(L, L + N);

    int acc = 0;
    REP(0, i, N) {
        acc += L[i];
    }

    if (acc > 2 * L[N - 1]) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |     sort(L, L + N);
      |     ^~~~
      |     short
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> L(N);
  for(int i=0;i<N;i++){
    cin >> L.at(i);
  }
  sort(L.begin(),L.end());
  if(L.at(0) >= accumulate(L.begin(), L.end(), 0)){
    cout << "No" << endl;
  }
  else{
    cout << "Yes" << endl;
  }
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: bist/stdc++.h: No such file or directory
    1 | #include <bist/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int[] array = new int[n];
      int sum = 0;
      for(int i = 0;i < n;i++){
      	array[i] = sc.nextInt();
        sum += array[i];
      }
      for(int i = 1;i < n;i++){
      	array[i] = Math.max(array[i],array[i-1]);
      }
      if(array[i] < sum){
      	System.out.println("Yes");
      }else{
      	System.out.println("No");
      }
    }
}


Compiler output:
Main.java:15: error: cannot find symbol
      if(array[i] < sum){
               ^
  symbol:   variable i
  location: class Main
1 error
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int[] array = new int[];
      int sum = 0;
      for(int i = 0;i < n;i++){
      	array[i] = sc.nextInt();
        sum += array[i];
      }
      for(int i = 1;i < n;i++){
      	array[i] = Math.max(array[i],array[i-1]);
      }
      if(array[i] < sum){
      	System.out.println("Yes");
      }else{
      	System.out.println("No");
      }
    }
}

Compiler output:
Main.java:6: error: array dimension missing
      int[] array = new int[];
                             ^
1 error
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<int> a.(n);
  for(int i = 0; i < n; i++){
  	cin >> a.at(i);
  }
  
  int sum = 0;
  int m = 0;
  for(int i = 0; i < n; i++){
  	sum += a.at(i);
    m = max(m, a.at(i));
  }
  if(sum - m > m){
  	cout << "Yes" << endl;
  }
  else{
  	cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected initializer before '.' token
    7 |   vector<int> a.(n);
      |                ^
a.cc:9:16: error: 'a' was not declared in this scope
    9 |         cin >> a.at(i);
      |                ^
a.cc:15:16: error: 'a' was not declared in this scope
   15 |         sum += a.at(i);
      |                ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<int> a.(n);
  for(int i = 0; i < n; i++){
  	cin >> a.at(i);
  }
  
  int sum = 0;
  int m = 0;
  for(int i = 0; i < n; i++){
  	sum += a.at(i);
    m = max(m, a.at(i));
  }
  if(sum - m < m){
  	cout << "Yes" << endl;
  }
  else{
  	cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected initializer before '.' token
    7 |   vector<int> a.(n);
      |                ^
a.cc:9:16: error: 'a' was not declared in this scope
    9 |         cin >> a.at(i);
      |                ^
a.cc:15:16: error: 'a' was not declared in this scope
   15 |         sum += a.at(i);
      |                ^
Language: C++

#include<iostream>

using namespace std;

typedef long long LL;

int main(){
  LL n;
  cin >> n;
  LL a[n];
  for(int t = 0 ; t < n ; t++){
  
  	cin >> a[i];
  }
  
  LL flag = 0;
  LL m = 0;
  
  for(int t = 0; t < n; t ++){
  	if(a[t] > m){
    	m = a[t];
        flag = t;
    }
  }
  LL sum = 0;
  for(int t = 0; t < n; t++){
	if(t != flag)sum+= a[t];
  }
  
  
  if(sum > m)cout << "Yes";
  else cout << "No";

	return 0;
  
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: 'i' was not declared in this scope
   13 |         cin >> a[i];
      |                  ^
Language: C++

#include<iostream>

using namespace std;

typedef long long LL

int main(){
  LL n;
  cin >> n;
  LL a[n];
  for(int t = 0 ; t < n ; t++){
  
  	cin >> a[i];
  }
  
  LL flag = 0;
  LL m = 0;
  
  for(int t = 0; t < n; t ++){
  	if(a[t] > m){
    	m = a[t];
        flag = t;
    }
  }
  LL sum = 0;
  for(int t = 0; t < n; t++){
	if(t != flag)sum+= a[t];
  }
  
  
  if(sum > m)cout << "Yes";
  else cout << "No";

	return 0;
  
  
  
}

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

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

int main(){
  int N;
  cin >> N;
  int A[N];
  int sum = 0;
  for(int i=0;i<N;i++){
    cin >> A[i];
    sum += A[i];
  }
  sort(A, A+N);
  ans -= A[N-1];
  if(ans > A[N-1]) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |   ans -= A[N-1];
      |   ^~~
      |   abs
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> l(N);
  for (int i=0; i<N; ++i) {
    cin >> l.at(i);
  }
  sort(l.begin(), l.end(), greater<int>());
  int sum = 0;
  int longest = l.at(0);
  for (int i=1; i<N; ++i) {
    sum += v.at(i);
  }
  if (longest < sum) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'v' was not declared in this scope
   15 |     sum += v.at(i);
      |            ^
Language: C++

#include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
#include <math.h>
#include <utility>
#include <map>
#include <queue>
#include <stack>

using namespace std;

#define INF 210000000
#define int long long

int gcd(int a, int b) {
  int amari = a % b;
  int c = b;
  if (amari == 0) {
    return b;
  } else {
    return gcd(b, amari);
  }
}

int lcm(int a, int b) { return a * b / gcd(a, b); }

signed main() {
		int n;
		cin >> n;
		vector<int> a;
		for(int i=0;i<n;i++){
				int tmp;
				cin >> tmp;
				a.push_back(tmp);
		}
		auto max = max_element(a.begin(),a.end());
		int sum = accumulate(a.begin(),a.end(),0);
		if(sum > *max * 2){
				cout << "Yes";
		}else{
				cout << "No";
		}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:39:27: error: 'accumulate' was not declared in this scope
   39 |                 int sum = accumulate(a.begin(),a.end(),0);
      |                           ^~~~~~~~~~
Language: Java

import java.util.Scanner;

class Main {
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int max = 0;
    int sum = 0;
    while(sc.hasNext()){
      int newone = sc.nextInt();
      if(newone > max){
        max = newone
      }
      sum = sum + newone;
    }
    sum = sum - max;
    System.out.println(max < sum ? "Yes" : "No");
  }
}


Compiler output:
Main.java:12: error: ';' expected
        max = newone
                    ^
1 error
Language: C++

int main(){
    
    int n; cin >> n;
    int s = 0,m = 0,i = 0;
    while (i < n){
        int k; cin >> k;
        s = s + k;
        if(k > m){
            m = k;
        }
        i++;
    }
    if (m < s - m){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:12: error: 'cin' was not declared in this scope
    3 |     int n; cin >> n;
      |            ^~~
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:14:26: error: 'endl' was not declared in this scope
   14 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout << "No" << endl;
      |         ^~~~
a.cc:17:25: error: 'endl' was not declared in this scope
   17 |         cout << "No" << endl;
      |                         ^~~~
Language: C++

int main(){
    
    int n; cin >> n;
    int s,m = 0,i = 0;
    while (i < n){
        int k; cin >> k;
        s = s + k;
        if(k > m){
            m = k;
        }
        i++;
    }
    if (m < s - m){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:12: error: 'cin' was not declared in this scope
    3 |     int n; cin >> n;
      |            ^~~
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout << "Yes" << endl;
      |         ^~~~
a.cc:14:26: error: 'endl' was not declared in this scope
   14 |         cout << "Yes" << endl;
      |                          ^~~~
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout << "No" << endl;
      |         ^~~~
a.cc:17:25: error: 'endl' was not declared in this scope
   17 |         cout << "No" << endl;
      |                         ^~~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  
  int sum = 0;
  
  vector<int> l(n);
  for (int i=0; i<n; i++){
    cin >> l.at(i);
    sum += l.at(i);
  }
  
  int M = max_element(l.begin(),l.end());
  
  if (sum-M > M) cout << "Yes" << endl;
  else cout << "No" << endl;
  
}


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

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

int main() {
	int n,l,sum=0,max=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>l;
		sum+=l;
		max=max(max,l);
	}
	if((sum-max)>max){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: 'max' cannot be used as a function
   10 |                 max=max(max,l);
      |                     ~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){

	int n; cin >> n;
	int s = 0, m = 0;

	for(int i=0; i<n; i++){
		int L; cin >> L;
		s + L = s;
		m = max(m, L);
	}

	if(m < s - m){
		cout <<Yes<<endl;
	}
	
	else{
		cout <<No<<endl;
	}
	
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: lvalue required as left operand of assignment
   12 |                 s + L = s;
      |                 ~~^~~
a.cc:17:24: error: 'Yes' was not declared in this scope
   17 |                 cout <<Yes<<endl;
      |                        ^~~
a.cc:21:24: error: 'No' was not declared in this scope
   21 |                 cout <<No<<endl;
      |                        ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){

	int n; cin >> n;
	int s = 0, m = 0;

	for(int i=0; i<n; i++){
		int L; cin >> L;
		s + L = s;
		m = max(m, L);
	}

	if(m < s - m){
		cout << "Yes" << endl;
	}
	
	else{
		cout << "No" << endl;
	}
	
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: lvalue required as left operand of assignment
   12 |                 s + L = s;
      |                 ~~^~~
Language: C++

#include <stdio.h>
#define MAX(maxN,m) ((maxN) > (m) ? (maxN) : (m))

int main(){
    int n;

    scanf("%d", &n);

    int maxN = 0, total = 0;
    for (int i = 0; i<n; i++) {
        int m;

        scanf("%d", &m);

        maxN = MAX(maxN, m);
        total += m;
    }

    printf("%s", maxN < total - maxN ? "Yes" : "No");
    
    if(scanf("%d/%d", &numerator, &denominator) < 2) {
    fprintf(stderr, "error: ill-formed fraction.\n");
    exit(1);
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: 'numerator' was not declared in this scope
   21 |     if(scanf("%d/%d", &numerator, &denominator) < 2) {
      |                        ^~~~~~~~~
a.cc:21:36: error: 'denominator' was not declared in this scope
   21 |     if(scanf("%d/%d", &numerator, &denominator) < 2) {
      |                                    ^~~~~~~~~~~
a.cc:23:5: error: 'exit' was not declared in this scope
   23 |     exit(1);
      |     ^~~~
a.cc:2:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    1 | #include <stdio.h>
  +++ |+#include <cstdlib>
    2 | #define MAX(maxN,m) ((maxN) > (m) ? (maxN) : (m))
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

int main(void)
{
    int N;
    std::cin >> N;

    std::vector<int> L(N);
    for(int i = 0; i < N; i++)
    {
        std::cin >> L[i];
    }

    int L_max = *std::max_element(L.begin(), L.end());
    int L_max_index = std::distance(L.begin(), *L_max));

    int sum = 0;
    for(int i = 0; i < N; i++)
    {
        if(i == L_max_index)
        {
            continue;
        }

        sum += L[i];
    }

    if(L_max >= sum)
    {
        std::cout << "No" << std::endl;
    }

    else
    {
        std::cout << "Yes" << std::endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:48: error: invalid type argument of unary '*' (have 'int')
   17 |     int L_max_index = std::distance(L.begin(), *L_max));
      |                                                ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)

int main(int argc, char const *argv[])
{
	int n; cin >> n;
	vector<int> l(n); rep(i, n) cin >> l[i];
	sort(l.begin(), l.end());
	int sum = accumulate(l.begin(), l.end() - 1, 0);
	int ma = l.back();
	if (sum > ma) printf("Yes\n");
	else printf("No\n");
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)

int main(int argc, char const *argv[])
{
	int n; cin >> n;
	vector<int> l(n); rep(i, n) cin >> l[i];
	sort(l.begin(), l.end());
	int sum = accumulate(l.begin(), l.end() - 1, 0);
	int ma = l.back();
	if (sum > ma) printf("Yes\n");
	else printf("No\n");
	return 0;
}


Compiler output:
a.cc:22:5: error: redefinition of 'int main(int, const char**)'
   22 | int main(int argc, char const *argv[])
      |     ^~~~
a.cc:6:5: note: 'int main(int, const char**)' previously defined here
    6 | int main(int argc, char const *argv[])
      |     ^~~~
Language: C++

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

int main(){
  int N;
  cin >> N,sum=0;
  vector<int> L(N);
  for(int i=0; i<N; i++){
    cin >> L.at(i);
    sum+=L.at(i);
  }
  sort(L.begin(), L.end());
  sum-=2*L.at(N-1);
  if(sum>0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'sum' was not declared in this scope
    6 |   cin >> N,sum=0;
      |            ^~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<int>a;
  for(int i=0; i<n; ++i){
    cin >>a[i];
  }
  sort(a.begin(), a.end())
    reverse(a.begin(), a.end())
  int sum;
  for(int i=1; i<=n; ++i){
    sum +=a[i];
  }
  if(sum>a[0])cout<<'YES'<<endl;
  else cout<<'NO'<<endl;
}
    

Compiler output:
a.cc:19:21: warning: multi-character character constant [-Wmultichar]
   19 |   if(sum>a[0])cout<<'YES'<<endl;
      |                     ^~~~~
a.cc:20:14: warning: multi-character character constant [-Wmultichar]
   20 |   else cout<<'NO'<<endl;
      |              ^~~~
a.cc: In function 'int main()':
a.cc:13:27: error: expected ';' before 'reverse'
   13 |   sort(a.begin(), a.end())
      |                           ^
      |                           ;
   14 |     reverse(a.begin(), a.end())
      |     ~~~~~~~                
a.cc:17:5: error: 'sum' was not declared in this scope
   17 |     sum +=a[i];
      |     ^~~
a.cc:19:6: error: 'sum' was not declared in this scope
   19 |   if(sum>a[0])cout<<'YES'<<endl;
      |      ^~~
Language: C

#include<stdio.h>
#define N 100

int main(){
  int n,l[N],max=0,sum=0;
  
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&l[i]);
    sum += l[i];
  }
  
  for(int j=0;j<n;j++){
    if(max<=l[i]) max = l[i];
  }
   
  if(max<sum-max) printf("Yes");
  else printf("No");

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:15: error: 'i' undeclared (first use in this function)
   14 |     if(max<=l[i]) max = l[i];
      |               ^
main.c:14:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main() {
  int n,max,sub,l;
  cin >> n;
  cin >> sub;
  max = sub;
  l = sub;
  for(int i = 1; i < n; i++){
    cin >> sub;
    max = max(max,sub);
    l += sub;
  }
  if(max * 2 < l)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'max' cannot be used as a function
   12 |     max = max(max,sub);
      |           ~~~^~~~~~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  vector<int> L(N);
  
  for (int i = 0; i < N; i++) {
    cin >> L.at(i)
  }
  
  sort(L.begin(), L.end());
  
  int sum = 0;
  
  for (int i = 0; i < N; i++) {
    if (i < N - 1) {
      sum += L.at(i);
      continue;
    }
    
    if (sum > L.at(i)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before '}' token
   11 |     cin >> L.at(i)
      |                   ^
      |                   ;
   12 |   }
      |   ~
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  vector<int> L(N);
  
  for (int i = 0; i < N; i++) {
    cin >> L.at(i)
  }
  
  sort(L.begin(), L.end());
  
  int sum = 0;
  
  for (int i = 0; i < N; i++) {
    if (i < N - 1) {
      sum += A.at(i);
      continue;
    }
    
    if (sum > A.at(i)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before '}' token
   11 |     cin >> L.at(i)
      |                   ^
      |                   ;
   12 |   }
      |   ~                
a.cc:20:14: error: 'A' was not declared in this scope
   20 |       sum += A.at(i);
      |              ^
a.cc:24:15: error: 'A' was not declared in this scope
   24 |     if (sum > A.at(i)) {
      |               ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    cin >> n;
    int vec[n];
    for(int i = 0; i < n; i++) {
        cin >> vec[i];
        }
    sort(vec, vec+n);

    int max = vec[n-1];
    int sum = 0;
    for(int i = 0; i < n; i++) {
        sum =+ vec[i]
    }

    if(max > sum){
        cout << "Yes" << endl;
    }
    else if(max <= sum){
        cout << "No" << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: expected ';' before '}' token
   17 |         sum =+ vec[i]
      |                      ^
      |                      ;
   18 |     }
      |     ~
Language: C++

#include <stdio.h>

int max(int a[])
{
	int ans = a[0];
	
	for(int i = 1; i < n; i++){
		if(a[i] > ans){
			ans = a[i];
		}
	}
	return ans;
}

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

int main(void)
{
	int n;
	scanf("%d",&n);
	int l[n];
	
	for(int i = 0; i < n; i++){
		scanf("%d",&l[i]);
	}
	
	int saidai = max(l);
	
	int total = sum(l);
	
	if(saidai < total - saidai){
		printf("Yes\n");
	}else{
		printf("No\n");
	}
	
	return 0;
}
	
	
	
	

Compiler output:
a.cc: In function 'int max(int*)':
a.cc:7:28: error: 'n' was not declared in this scope
    7 |         for(int i = 1; i < n; i++){
      |                            ^
a.cc: In function 'int sum(int*)':
a.cc:18:28: error: 'n' was not declared in this scope
   18 |         for(int i = 0; i < n; i++){
      |                            ^
Language: C++

#include <stdio.h>

int max(int a[])
{
	int ans = a[0];
	
	for(int i = 1; i < n; i++){
		if(a[i] > ans){
			ans = a[i];
		}
	}
	return ans;
}

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

int main(void)
{
	int n;
	scanf("%d",&n);
	int l[n];
	
	for(int i = 0; i < n; i++){
		scanf("%d",&l[i]);
	}
	
	int max = max(l);
	
	int total = sum(l);
	
	if(max < total - max){
		printf("Yes\n");
	}else{
		printf("No\n");
	}
	
	return 0;
}
	
	
	
	

Compiler output:
a.cc: In function 'int max(int*)':
a.cc:7:28: error: 'n' was not declared in this scope
    7 |         for(int i = 1; i < n; i++){
      |                            ^
a.cc: In function 'int sum(int*)':
a.cc:18:28: error: 'n' was not declared in this scope
   18 |         for(int i = 0; i < n; i++){
      |                            ^
a.cc: In function 'int main()':
a.cc:35:22: error: 'max' cannot be used as a function
   35 |         int max = max(l);
      |                   ~~~^~~
Language: C++

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

int main() {
  int N;
  cin >>N;
  int sum=0;
  for(int i=0;i<N-1;i++){
    int l;
    cin >> l;
    sum+=l;
  }
  int r;
  if(r>l)cout << "YES" << endl;
  else cout << "NO" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: 'l' was not declared in this scope
   14 |   if(r>l)cout << "YES" << endl;
      |        ^
Language: Java

import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner (System.in);
        int N = sc.nextInt();
        int[] n = new int[N];
        int sum = 0;
        for(int i = 0;i < N;i++){
            n[i] = sc.nextInt();
        }
        Arrays.sort(n);
        for(int sum:n){
            sum += n;
        }
        System.out.println(n[N] < sum-n[N]?"Yes":"No");
        }
    }


Compiler output:
Main.java:12: error: variable sum is already defined in method main(String[])
        for(int sum:n){
                ^
Main.java:13: error: bad operand types for binary operator '+'
            sum += n;
                ^
  first type:  int
  second type: int[]
2 errors
Language: Java

import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner (System.in);
        int N = sc.nextInt();
        int[] n = new int[N];
        int sum = 0;
        for(int i = 0;i < N;i++){
            n[i] = sc.nextInt();
        }
        Arrays.sort(n);
        for(int sum:n){
            sum += n;
        }
        System.out.println(n[N] < sum-n[N]?"Yes":"No");
        }
    }
}

Compiler output:
Main.java:18: error: class, interface, enum, or record expected
}
^
1 error
Language: C++

int main() {
    int N; cin >> N;
    int A[20];
    int sum=0;
    for(int i = 0; i < N; i++) {
        cin >> A[i];
        sum += A[i];
    }
    sort(A,A+N);
    if(sum-2*A[N-1] > 0)
    cout << "Yes" << endl;
    else
    {
      cout << "No" << endl;
    }
     

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:12: error: 'cin' was not declared in this scope
    2 |     int N; cin >> N;
      |            ^~~
a.cc:9:5: error: 'sort' was not declared in this scope; did you mean 'short'?
    9 |     sort(A,A+N);
      |     ^~~~
      |     short
a.cc:11:5: error: 'cout' was not declared in this scope
   11 |     cout << "Yes" << endl;
      |     ^~~~
a.cc:11:22: error: 'endl' was not declared in this scope
   11 |     cout << "Yes" << endl;
      |                      ^~~~
a.cc:14:7: error: 'cout' was not declared in this scope
   14 |       cout << "No" << endl;
      |       ^~~~
a.cc:14:23: error: 'endl' was not declared in this scope
   14 |       cout << "No" << endl;
      |                       ^~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> L(N);
  for(int i=0;i<N;i++){
    cin >> L.at(i);
  }
  sort(L.begin(), L.end());
  int count=0;
  for(int i=0;i<N-1;i++){
    count+=L.at(i)
  }
  if(count>L.at(N-1)){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: expected ';' before '}' token
   14 |     count+=L.at(i)
      |                   ^
      |                   ;
   15 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main (){
  int N,sum=0;
  cin>>N;
  vector<int>a(N);
  sort(a.begin(),a.end());
  for(int i=1;i<N;i++){
    sum=sum+a[i];
  }
  if(a[1]>=sum){
    cout<<Yes<<endl;
  }
  else{
    cout<<No<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'Yes' was not declared in this scope
   12 |     cout<<Yes<<endl;
      |           ^~~
a.cc:15:11: error: 'No' was not declared in this scope; did you mean 'N'?
   15 |     cout<<No<<endl;
      |           ^~
      |           N
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n, sum=0;
  cin >> n;
  int l[n];
  for(int i=0; i<n; i++)
    cin >> l[i];
  sort(l, l+n);
  for(int i=0; i<n-1; i++)
    sum+=l[i];
  if(sum>l[n-1]) cout << "Yes";
  else cout << "No";
  return 0;
}


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

#include<iostream>
using namespace std;

int main(){
  int N;
  int s=0;
  cin>>N;
  int a[N];
  
  for(int i=0;i<N;i++){
    cin>>a[i];
  }
  
  for(int i=0;i<N;i++){
    int v = a[i];
    int j = i-1;
    while(j>=0 && a[j] < v){
      a[j+1]=a[j];
      j--;
    }
    a[j+1]=v;
  }
  
  for(i=0;i<N;i++) s += a[i];
  if(s>a[0]) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: 'i' was not declared in this scope
   24 |   for(i=0;i<N;i++) s += a[i];
      |       ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int N;
  int s=0;
  cin>>N;
  int a[N];
  
  for(int i=0;i<N;i++){
    cin>>a[i];
  }
  
  for(int i=0;i<N;i++){
    int v = a[i];
    int j = i-1;
    while(j>=0 && a[j] < v){
      a[j+1]=a[j];
      j--;
    }
    a[j+1]=v;
  }
  
  for(i=0;i<N;i++) s += a[i];
  if(s>a[0]) cout"Yes"<<endl;
  else cout<<"No"<<endl;
  
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: 'i' was not declared in this scope
   24 |   for(i=0;i<N;i++) s += a[i];
      |       ^
a.cc:25:18: error: expected ';' before string constant
   25 |   if(s>a[0]) cout"Yes"<<endl;
      |                  ^~~~~
      |                  ;
Language: C++

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

int main(){
    int N,L,MAX=0,sum=0;
    double ans;
    int ans;

    cin >>N;
    for (int i = 0; i < N; i++){
        cin >> L;
        sum += L;
        MAX=max(MAX,L);

    }
    if(MAX>(sum-MAX))cout << "Yes" <<endl;
    else cout << "No" <<endl;
    
    //cout << ans <<endl;

    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: conflicting declaration 'int ans'
    8 |     int ans;
      |         ^~~
a.cc:7:12: note: previous declaration as 'double ans'
    7 |     double ans;
      |            ^~~
Language: C++

#include <iostream>

using namespace std;

int main(){
  int N, L;
  cin >> N;
  
  for(int i = 0; i <= N; i++){
    cin >> L;
    sum += L;
  }
  
  if(N < L)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'sum' was not declared in this scope
   11 |     sum += L;
      |     ^~~
Language: C++

#include <iostream>]

using namespace std;

int main(){
  int N, L;
  cin >> N;
  
  for(int i = 0; i <= N; i++){
    cin >> L;
    sum += L;
  }
  
  if(N < L)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <iostream>]
      |                    ^
a.cc: In function 'int main()':
a.cc:11:5: error: 'sum' was not declared in this scope
   11 |     sum += L;
      |     ^~~
Language: C++

#include<stdio.h>
#include<algorithm>
using namespace std;
int main(void)
{
	int N, L[10],wa=0;
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%d", &L[i]);
	}
	sort(L, L + N, greater<int>());
	for (int i = 1; i < N; i++) {
		wa += L[i];
	}
	if (L[0] < wa) {
		printf("Yes");
	}
	else {
		printf("No");;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: 'greater' was not declared in this scope
   11 |         sort(L, L + N, greater<int>());
      |                        ^~~~~~~
a.cc:11:32: error: expected primary-expression before 'int'
   11 |         sort(L, L + N, greater<int>());
      |                                ^~~
Language: C++

#include<stdio.h>
int main(void)
{
	int N, L[10];
	int Max = 0;
	int sum = 0;
	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%d", &L[i]);

		if (i == 0) {
			Max = L[0];
		}


		else if (L[i] > Max) {
			sum = sum + Max;
			Max = L[i];
		}
		else //if (L[i] <= L[i - 1]) {
			sum = sum + L[i];
		//}
	}

	if (Max < sum) {
		printf("Yes");
	}
	else
		printf("No");

	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:31:18: error: expected '}' at end of input
   31 |         return 0;
      |                  ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  
  vector<int>L(N);
  
  for(int i=0;i<L.size();i++){
    cin>>L.at(i);
  }
  
  int sum=0;
  int max=0;
  
  for(int i=0;i<N;i++){
    if(max<=L.at(i)){
      max=L.at(i);
        sum+=L.at(i);
    }
    else{
      sum+=L.at(i);
  }
  
  if(sum-max>max){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

 


Compiler output:
a.cc: In function 'int main()':
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  
  vector<int>L(N);
  
  for(int i=0;i<L.size();i++){
    cin>>L.at(i);
  }
  
  int sum=0;
  int max=0;
  
  for(int i=0;i<N;i++){
    if(max<=L.at(i)){
      max=L.at(i)
        sum+=L.at(i);
    }
    else{
     sum+=L.at(i);
    }
    
  }
  
  if(sum-max>max){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

 


Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: expected ';' before 'sum'
   18 |       max=L.at(i)
      |                  ^
      |                  ;
   19 |         sum+=L.at(i);
      |         ~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  
  vector<int>L(N);
  
  for(int i=0;i<L.size();i++){
    cin>>L.at(i);
  }
  
  int sum=0;
  int max=0;
  
  for(int i=0;i<N;i++){
    if(max<=L.at(i)){
      max=L.at(i)
        sum+=L.at(i);
    }
  }
  
  if(sum-max>max){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

 

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: expected ';' before 'sum'
   18 |       max=L.at(i)
      |                  ^
      |                  ;
   19 |         sum+=L.at(i);
      |         ~~~
Language: C++

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
      int n,sum=0;
      cin>>n;
      int a[n];
      for(ll i=0;i<n;i++)
      {
        cin>>a[i];
        sum+=a[i];
      }
      sort(a,a+n);
      sum -=a[n-1];
      if(sum>a[n-1])
        cout<<"Yes";
      else cout<<"No";
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'll' was not declared in this scope
    8 |       for(ll i=0;i<n;i++)
      |           ^~
a.cc:8:18: error: 'i' was not declared in this scope
    8 |       for(ll i=0;i<n;i++)
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  ll n,sum=0;
  cin>>n;
  ll a[n];
  for(ll i=0;i<n;i++)
  {
    cin>>a[i];
    sum+=a[i];
  }
  sort(a,a+n);
  sum -=a[n-1];
  if(sum>a[n-1])
    cout<<"Yes";
  else cout<<"No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll n,sum=0;
      |   ^~
a.cc:6:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   cin>>n;
      |        ^
      |        yn
a.cc:7:5: error: expected ';' before 'a'
    7 |   ll a[n];
      |     ^~
      |     ;
a.cc:8:9: error: expected ';' before 'i'
    8 |   for(ll i=0;i<n;i++)
      |         ^~
      |         ;
a.cc:8:14: error: 'i' was not declared in this scope
    8 |   for(ll i=0;i<n;i++)
      |              ^
a.cc:10:10: error: 'a' was not declared in this scope
   10 |     cin>>a[i];
      |          ^
a.cc:11:5: error: 'sum' was not declared in this scope
   11 |     sum+=a[i];
      |     ^~~
a.cc:13:8: error: 'a' was not declared in this scope
   13 |   sort(a,a+n);
      |        ^
a.cc:14:3: error: 'sum' was not declared in this scope
   14 |   sum -=a[n-1];
      |   ^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int N;
    int sum_value = 0;
    int max_value = -1;
    vector<int> L(N);
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> L[i];
    }
    for(int i = 0; i < N; i++){
        sum_value += L[i];
    }
    max_value = max(L.begin(),L.end());

    sum_value = sum_value - max_value;

    if(max_value < sum_value) cout << "Yes";
    else cout << "No";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: cannot convert 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   19 |     max_value = max(L.begin(),L.end());
      |                 ~~~^~~~~~~~~~~~~~~~~~~
      |                    |
      |                    const __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 int N;
  cin>>N;
 vector<int> L(N);
  
  for(int i=0;i<L.size();i++){
    cin>>L.at(i);
  }
  
    
    int max=max(L.begin(),L.end())
      
    int sum1=0;
    int sum2=0;
  
  for(int i=0;i<L.size();i++){
    if(L.at(i)!=max){
      L.at(i)+=sum1;
    else if(L.at(i)==max&&sum2==0){
      sum++;
    }
      else if(L.at(i==max&&sum2!=0)){
        L.at(i)+=sum1;
      }
    }
    
    if(sum1>max){
      cout<<"Yes"<<endl;
    }
    else{
      cout<<"No"<<endl;
    }
  }
  
     
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'max' cannot be used as a function
   13 |     int max=max(L.begin(),L.end())
      |             ~~~^~~~~~~~~~~~~~~~~~~
a.cc:20:16: error: 'sum1' was not declared in this scope; did you mean 'sum2'?
   20 |       L.at(i)+=sum1;
      |                ^~~~
      |                sum2
a.cc:21:5: error: expected '}' before 'else'
   21 |     else if(L.at(i)==max&&sum2==0){
      |     ^~~~
a.cc:19:21: note: to match this '{'
   19 |     if(L.at(i)!=max){
      |                     ^
a.cc:22:7: error: 'sum' was not declared in this scope; did you mean 'sum2'?
   22 |       sum++;
      |       ^~~
      |       sum2
a.cc:25:18: error: 'sum1' was not declared in this scope; did you mean 'sum2'?
   25 |         L.at(i)+=sum1;
      |                  ^~~~
      |                  sum2
a.cc:29:8: error: 'sum1' was not declared in this scope; did you mean 'sum2'?
   29 |     if(sum1>max){
      |        ^~~~
      |        sum2