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

i;main(c){for(;(read(0,&c,1);)i+=c&1;printf("%d",i);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | i;main(c){for(;(read(0,&c,1);)i+=c&1;printf("%d",i);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int]
    1 | i;main(c){for(;(read(0,&c,1);)i+=c&1;printf("%d",i);}
      |   ^~~~
main.c: In function 'main':
main.c:1:3: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: implicit declaration of function 'read' [-Wimplicit-function-declaration]
    1 | i;main(c){for(;(read(0,&c,1);)i+=c&1;printf("%d",i);}
      |                 ^~~~
main.c:1:29: error: expected ')' before ';' token
    1 | i;main(c){for(;(read(0,&c,1);)i+=c&1;printf("%d",i);}
      |                ~            ^
      |                             )
main.c:1:31: error: expected ';' before 'i'
    1 | i;main(c){for(;(read(0,&c,1);)i+=c&1;printf("%d",i);}
      |                               ^
      |                               ;
main.c:1:38: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | i;main(c){for(;(read(0,&c,1);)i+=c&1;printf("%d",i);}
      |                                      ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | i;main(c){for(;(read(0,&c,1);)i+=c&1;printf("%d",i);}
main.c:1:38: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    1 | i;main(c){for(;(read(0,&c,1);)i+=c&1;printf("%d",i);}
      |                                      ^~~~~~
main.c:1:38: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:52: error: expected ')' before ';' token
    1 | i;main(c){for(;(read(0,&c,1);)i+=c&1;printf("%d",i);}
      |              ~                                     ^
      |                                                    )
main.c:1:53: error: expected expression before '}' token
    1 | i;main(c){for(;(read(0,&c,1);)i+=c&1;printf("%d",i);}
      |                                                     ^
Language: C++

#include <stdio.h>
int main(){
char c;
int ans=0;
while(scnaf("%c",&c)!=EOF){
if(c=='1')ans++;
}
printf("%d\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
    5 | while(scnaf("%c",&c)!=EOF){
      |       ^~~~~
      |       scanf
Language: C++

#include <iostream>
#include <string>
#include<vector>
#define NMAX 100000
#define pow(2, 30)
using namespace std;

int n, k;
struct Item {
  int value, weight;
};

Item items[NMAX];
int C[NMAX][KMAX];

void compute(int &maxValue){
  for(int w = 0; w <= k; w++) {
    C[0][w] = 0;
  }

  for(int i = 1; i <= n; i++){
    C[i][0] = 0;
  }

  for(int i = 1; i <=n; i++){
    for(int w = 1; w <= k; w++){
      C[i][w] = C[i-1][w];
      if(items[i].weight > w) continue;
      if (items[i].value || C[i-1][w - items[i].weight] > C[i-1][w]){
        C[i][w] = items[i].value + C[i-1][w - items[i].weight];
      }
    }
  }

  maxValue = C[n][k];


}


int main() {
  cin >> n >> k;
  for(int i = 1; i <= n; i++){
    cin >> items[i].weight >> items[i].value;
  }

  int maxValue;

  compute(maxValue);
  
  cout << maxValue << endl;

  return 0;
}

Compiler output:
a.cc:5:13: error: expected parameter name, found "2"
    5 | #define pow(2, 30)
      |             ^
a.cc:14:13: error: 'KMAX' was not declared in this scope; did you mean 'NMAX'?
   14 | int C[NMAX][KMAX];
      |             ^~~~
      |             NMAX
a.cc: In function 'void compute(int&)':
a.cc:18:5: error: 'C' was not declared in this scope
   18 |     C[0][w] = 0;
      |     ^
a.cc:22:5: error: 'C' was not declared in this scope
   22 |     C[i][0] = 0;
      |     ^
a.cc:27:7: error: 'C' was not declared in this scope
   27 |       C[i][w] = C[i-1][w];
      |       ^
a.cc:35:14: error: 'C' was not declared in this scope
   35 |   maxValue = C[n][k];
      |              ^
Language: C++

//
//  main.cpp
//  test
//
//  Created by kanebako on 2017/09/10.
//  Copyright © 2017 kanebako. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>

using namespace std;

int main(int argc, const char * argv[]) {
    int N;
    long double h, n, w;
    cin >> N;
    
    long double d;
    d = double(N) / 4.0;
    h = ceil(d);
    // cout << h << endl;
    
    n = ceil((double(N) * h) / (4 * h - double(N)));
    // cout << n << endl;
    
    w = (double(N) * h * n) / (4 * h * n - N * n - N * h);
    
    h = unsigned long(h);
    n = unsigned long(n);
    w = unsigned long(w);
    
    cout << h << n << w;
    
    

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:32:9: error: expected primary-expression before 'unsigned'
   32 |     h = unsigned long(h);
      |         ^~~~~~~~
a.cc:33:9: error: expected primary-expression before 'unsigned'
   33 |     n = unsigned long(n);
      |         ^~~~~~~~
a.cc:34:9: error: expected primary-expression before 'unsigned'
   34 |     w = unsigned long(w);
      |         ^~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin >> n;
    if (n % 2 == 0){
        cout << n << " " << n << " " << n / 2 << endl;
        return 0;
    }
    else {
        int x = 2;
        long long a = n;
        while (__gcd(x, a) != x){
            a *= 2;
            x *= 2;
            x += 2;
        }
        cout << a << " " << a << " " << 2 << endl;
        return 0;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: no matching function for call to '__gcd(int&, long long int&)'
   15 |         while (__gcd(x, a) != x){
      |                ~~~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   template argument deduction/substitution failed:
a.cc:15:21: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('int' and 'long long int')
   15 |         while (__gcd(x, a) != x){
      |                ~~~~~^~~~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
int x[6];
int sum = 0;
for(int i = 0; i<6; i++){
cin >> x[i] ;
for(int i = 0; i<6; i++){
if(x[i]==1){sum = sum + 1;}
else{sum = sum + 0;}
}
cout << sum << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: Java

import java.util.*;


public class Main{
	public static void main(String[] args){
		
		
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();   
        int count = 0;
        
        String con = String.valueOf(S);
        String s[] = con.split("");
        int con2[] = Stream.of(s).mapToInt(Integer::parseInt).toArray();

        
        for(int i=0; i<con2.length; i++){
        	if(con2[i] == 1){
        		count++;
        	}
        }
        
    
	   
	   System.out.println(count);
	 }
}


Compiler output:
Main.java:14: error: cannot find symbol
        int con2[] = Stream.of(s).mapToInt(Integer::parseInt).toArray();
                     ^
  symbol:   variable Stream
  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 S = sc.nextInt();   
        int count = 0;
        
        String con = String.valueOf(S);
        String s[] = con.split("");
        int con2[] = Stream.of(s).mapToInt(Integer::parseInt).toArray();

        
        for(int i=0; i<con2.length; i++){
        	if(con2[i] == 1){
        		count++;
        	}
        }
        
    
	   
	   System.out.println(count);
	 }
}


Compiler output:
Main.java:4: error: class main is public, should be declared in a file named main.java
public class main{
       ^
Main.java:14: error: cannot find symbol
        int con2[] = Stream.of(s).mapToInt(Integer::parseInt).toArray();
                     ^
  symbol:   variable Stream
  location: class main
2 errors
Language: C++

#include<iostream>
using namespace std;
int main()
{
int x[6];
int sum = 0;
for(int i = 0; i<6; i++){
cin >> x[i] ;
for(int i = 0; i<6; i++){
if(x[i]=1){sum = sum + 1;}
else{sum = sum + 0;}
}
cout << sum << endl;
return 0;
}

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

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

int main (void) {
  string str;
  cin >> str;
  char* cstr = new char[str.size() + 1]; // メモリ確保
  std::strcpy(cstr, str.c_str());        // コピー
  int sum = 0;
  for (int i = 0; i < str.size(); i++){
    if(cstr[i] == '1'){
      sum += 1;
    }
  }
  cout << sum << endl;
  return 0;
}

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

#include <stdio.h>

int main(void)
{
    int s;
    int n = 0;
    scanf("%d", &s);
    if (s / 100000)
        n++;
    if (s % 100000 / 10000)
        n++;
    if (s % 10000 / 1000)
        n++;
    if (s % 1000 / 100)
        n++;
    if (s % 100 / 10)
        n++;
    if (s % 10)
        n++
    printf("%d\n", n);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:12: error: expected ';' before 'printf'
   19 |         n++
      |            ^
      |            ;
   20 |     printf("%d\n", n);
      |     ~~~~~~
Language: C++

  scanf("%s",s);
  int tot = 0;

  rep(i, 6) {
    tot += s[i] - '0';
  }

  printf("%d\n", tot);
  return 0;
}


Compiler output:
a.cc:1:8: error: expected constructor, destructor, or type conversion before '(' token
    1 |   scanf("%s",s);
      |        ^
a.cc:4:6: error: expected constructor, destructor, or type conversion before '(' token
    4 |   rep(i, 6) {
      |      ^
a.cc:8:9: error: expected constructor, destructor, or type conversion before '(' token
    8 |   printf("%d\n", tot);
      |         ^
a.cc:9:3: error: expected unqualified-id before 'return'
    9 |   return 0;
      |   ^~~~~~
a.cc:10:1: error: expected declaration before '}' token
   10 | }
      | ^
Language: Java

import java.util.*;


public class main{
	public static void main(String[] args){
		
		
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();   
        int count = 0;
        
        for(char S: str.toCharArray()){
		  if(S == 1){
			count++;
		  }
	   }
	   
	   System.out.println(count);
	 }
}


Compiler output:
Main.java:4: error: class main is public, should be declared in a file named main.java
public class main{
       ^
Main.java:12: error: cannot find symbol
        for(char S: str.toCharArray()){
                    ^
  symbol:   variable str
  location: class main
Main.java:12: error: variable S is already defined in method main(String[])
        for(char S: str.toCharArray()){
                 ^
3 errors
Language: Java

import.java.util.*;


public class main{
	public static void main(String[] args){
		
		
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();   
        int count = 0;
        
        for(char S: str.toCharArray()){
		  if(S == 1){
			count++;
		  }
	   }
	   
	   System.out.println(count);
	 }
}


Compiler output:
Main.java:1: error: <identifier> expected
import.java.util.*;
      ^
1 error
Language: Java

import.java.util.*;

public class main{
	public static void main(String[] args){
		
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();   
        int count = 0;
        
        for(char S: str.toCharArray()){
		  if(x == 1){
			count++;
		  }
	   }
	   
	   System.out.println(count);
	 }
}

Compiler output:
Main.java:1: error: <identifier> expected
import.java.util.*;
      ^
1 error
Language: Java

public class main{
	public static void main(String[] args){
		
		import.java.util.*;
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();   
        int count = 0;
        
        for(char S: str.toCharArray()){
		  if(S == 1){
			count++;
		  }
	   }
	   
	   System.out.println(count);
	 }
}

Compiler output:
Main.java:4: error: illegal start of expression
		import.java.util.*;
		^
Main.java:4: error: <identifier> expected
		import.java.util.*;
		                 ^
Main.java:4: error: illegal start of expression
		import.java.util.*;
		                  ^
3 errors
Language: Java


import java.util.Scanner;

public class IQ22 {
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        int count = 0;
        for (int i = 0;i < s.length();++i){
            if(s.charAt(i) == '1')++count;
        }
        System.out.println(count);
    }





}

Compiler output:
Main.java:4: error: class IQ22 is public, should be declared in a file named IQ22.java
public class IQ22 {
       ^
1 error
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
               int count = 0;
               for ( int i = 0; i < 6; i++ ) {
                   char c = s.charAt(i);
                   if ( c == '1' ) count++;
               }
               System.out.println(c);
	}
}

Compiler output:
Main.java:11: error: cannot find symbol
               System.out.println(c);
                                  ^
  symbol:   variable c
  location: class Main
1 error
Language: C

#include<stdio.h>
int main(){
 int s,count,check;
 scanf("%d",&s);
 count=0;
 do{
 check=s%10;
 if(check==1) count++;
 s=s/10
 }while(s!=0);
printf("%d",count);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:8: error: expected ';' before '}' token
    9 |  s=s/10
      |        ^
      |        ;
   10 |  }while(s!=0);
      |  ~
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
               int count = 0;
               for ( int i = 0; i < 6; i++ ) {
                   char c = s.charAt(i);
                   if ( c = '1' ) count++;
               }
               System.out.println(c);
	}
}

Compiler output:
Main.java:9: error: incompatible types: char cannot be converted to boolean
                   if ( c = '1' ) count++;
                          ^
Main.java:11: error: cannot find symbol
               System.out.println(c);
                                  ^
  symbol:   variable c
  location: class Main
2 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
　　　　 String s = sc.next();
               int count = 0;
               for ( int i = 0; i < 6; i++ ) {
                   char c = s.charAt(i);
                   if ( c = '1' ) count++;
               }
               System.out.println(c);
	}
}

Compiler output:
Main.java:5: error: illegal character: '\u3000'
???? String s = sc.next();
^
Main.java:5: error: illegal character: '\u3000'
???? String s = sc.next();
 ^
Main.java:5: error: illegal character: '\u3000'
???? String s = sc.next();
  ^
Main.java:5: error: illegal character: '\u3000'
???? String s = sc.next();
   ^
4 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
                //文字列の入力
　　　　 String s = sc.next();
               int count = 0;
               for ( int i = 0; i < 6; i++ ) {
                   char c = s.charAt(i);
                   if ( c = '1' ) count++;
               }
               System.out.println(c);
	}
}

Compiler output:
Main.java:6: error: illegal character: '\u3000'
???? String s = sc.next();
^
Main.java:6: error: illegal character: '\u3000'
???? String s = sc.next();
 ^
Main.java:6: error: illegal character: '\u3000'
???? String s = sc.next();
  ^
Main.java:6: error: illegal character: '\u3000'
???? String s = sc.next();
   ^
4 errors
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int count = 0;
		for(int i = 0; i < s.length(); i++){
			if(s.charAt(i) == '1){
				count++;
			}
		}
		System.out.println(count);
    }
}

Compiler output:
Main.java:9: error: unclosed character literal
			if(s.charAt(i) == '1){
			                  ^
1 error
Language: Java

public class Main {
public static void maik(String[] args) {
String s = new Scanner(System.in).next();
char[] c = s.toCharArray();
int count = 0;
for(char ch:c){
if(ch=='1'){
count++;
}
System.out.println(count);
}
}
}

Compiler output:
Main.java:3: error: cannot find symbol
String s = new Scanner(System.in).next();
               ^
  symbol:   class Scanner
  location: class Main
1 error
Language: Java

public class Main {
public static void maik(String[] args) {
String s = new Scanner(System.in).next();
char[] c = s.toCharArray();
int count = 0;
for(char ch:c){
if(ch=='1'){
count++
}
System.out.println(count);
}
}
}

Compiler output:
Main.java:8: error: ';' expected
count++
       ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
   for(int i=0;i<6;i++)
    {
     if(s[i]=='1') cnt++;
}
cout<<cnt;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: 'cnt' was not declared in this scope; did you mean 'int'?
    9 |      if(s[i]=='1') cnt++;
      |                    ^~~
      |                    int
a.cc:11:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   11 | cout<<cnt;
      |       ^~~
      |       int
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define IO(x) freopen(x".in", "r", stdin); freopen(x".out", "w", stdout);
const int INF = 0x3f3f3f3f;
//void upd(ll &x,ll y) { x=(x+y)%mod; }
char str[10];
int main()
{
	gets(str);
	int len=strlen(str);
	int cnt=0;
	rep(i,0,len) if(str[i]=='1') cnt++;
	cout<<cnt;
	
	
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   32 |         gets(str);
      |         ^~~~
      |         getw
Language: C++

in>>s;
    int ans=0;
    for(int i=0;i<s.length();i++)
        if(s[i]=='1')ans++;
    cout<<ans;

    return 0;
}


Compiler output:
a.cc:1:1: error: 'in' does not name a type; did you mean 'int'?
    1 | in>>s;
      | ^~
      | int
a.cc:3:5: error: expected unqualified-id before 'for'
    3 |     for(int i=0;i<s.length();i++)
      |     ^~~
a.cc:3:17: error: 'i' does not name a type
    3 |     for(int i=0;i<s.length();i++)
      |                 ^
a.cc:3:30: error: 'i' does not name a type
    3 |     for(int i=0;i<s.length();i++)
      |                              ^
a.cc:5:5: error: 'cout' does not name a type
    5 |     cout<<ans;
      |     ^~~~
a.cc:7:5: error: expected unqualified-id before 'return'
    7 |     return 0;
      |     ^~~~~~
a.cc:8:1: error: expected declaration before '}' token
    8 | }
      | ^
Language: C++

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

using namespace std;
using p = vector<int>(2);

int main(){
  int n;
  vector<p> ab(n);
  for(int i=0;i<n;i++)cin>>ab[i][0]>>ab[i][1];
  ab.emplace(1,1000000000);
  ab.emplace(1000000000,0);
  sort(ab.begin(),ab.end());
  lint ans=0;
  for(int i=0;i<=n;i++)ans+=min(ab[i][0]-ab[i+1][0],ab[i][1]-ab[i+1][1]);
  cout<<ans<<endl;
}

Compiler output:
a.cc:6:22: error: expected ';' before '(' token
    6 | using p = vector<int>(2);
      |                      ^
      |                      ;
a.cc: In function 'int main()':
a.cc:10:10: error: 'p' was not declared in this scope
   10 |   vector<p> ab(n);
      |          ^
a.cc:10:11: error: template argument 1 is invalid
   10 |   vector<p> ab(n);
      |           ^
a.cc:10:11: error: template argument 2 is invalid
a.cc:11:30: error: invalid types 'int[int]' for array subscript
   11 |   for(int i=0;i<n;i++)cin>>ab[i][0]>>ab[i][1];
      |                              ^
a.cc:11:40: error: invalid types 'int[int]' for array subscript
   11 |   for(int i=0;i<n;i++)cin>>ab[i][0]>>ab[i][1];
      |                                        ^
a.cc:12:6: error: request for member 'emplace' in 'ab', which is of non-class type 'int'
   12 |   ab.emplace(1,1000000000);
      |      ^~~~~~~
a.cc:13:6: error: request for member 'emplace' in 'ab', which is of non-class type 'int'
   13 |   ab.emplace(1000000000,0);
      |      ^~~~~~~
a.cc:14:11: error: request for member 'begin' in 'ab', which is of non-class type 'int'
   14 |   sort(ab.begin(),ab.end());
      |           ^~~~~
a.cc:14:22: error: request for member 'end' in 'ab', which is of non-class type 'int'
   14 |   sort(ab.begin(),ab.end());
      |                      ^~~
a.cc:15:3: error: 'lint' was not declared in this scope; did you mean 'uint'?
   15 |   lint ans=0;
      |   ^~~~
      |   uint
a.cc:16:24: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   for(int i=0;i<=n;i++)ans+=min(ab[i][0]-ab[i+1][0],ab[i][1]-ab[i+1][1]);
      |                        ^~~
      |                        abs
a.cc:16:35: error: invalid types 'int[int]' for array subscript
   16 |   for(int i=0;i<=n;i++)ans+=min(ab[i][0]-ab[i+1][0],ab[i][1]-ab[i+1][1]);
      |                                   ^
a.cc:16:44: error: invalid types 'int[int]' for array subscript
   16 |   for(int i=0;i<=n;i++)ans+=min(ab[i][0]-ab[i+1][0],ab[i][1]-ab[i+1][1]);
      |                                            ^
a.cc:16:55: error: invalid types 'int[int]' for array subscript
   16 |   for(int i=0;i<=n;i++)ans+=min(ab[i][0]-ab[i+1][0],ab[i][1]-ab[i+1][1]);
      |                                                       ^
a.cc:16:64: error: invalid types 'int[int]' for array subscript
   16 |   for(int i=0;i<=n;i++)ans+=min(ab[i][0]-ab[i+1][0],ab[i][1]-ab[i+1][1]);
      |                                                                ^
a.cc:17:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

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

int main(){
  int N;
  cin>>N;
  vector<int> V(N);
  vector<int> Z(N);
  for(int i=0;i<N;i++){
    cin>>V.at(i);
    cin>>Z.at(i);
 
  }
  sort(V.begin(),V.end());
  reverse(V.begin(),V.end());
  sort(Z.begin(),Z.end());
  cout<<V.at(0)+Z.at(0)<<endl;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:31: error: expected '}' at end of input
   17 |   cout<<V.at(0)+Z.at(0)<<endl;
      |                               ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <cassert>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define srep(i,n,m) for(int i=n;i<m;i++)
#define elif else if
#define INF 1000000007
#define pi 3.141592653589793
using namespace std;
int saidaikouyakusuu(int a,int b){
    if(b==0) return a;
    return saidaikouyakusuu(b,a%b);
}
int saisyoukoubaisuu(int a,int b){
    return a*b/saidaikouyakusuu(a,b);
}
int n,m,cnt=0,aa[220000],o=0,p;
pair<int,int> pp[220000];
string s,ss[220000];
char c,ca;
queue<int> que;
signed main(){
    cin>>n;
    rep(i,n){
        cin>>pp[i].second>>pp[i].first;
    }
    sort(pp,pp+n);
    cout<<pp[0].first+pp[i].second<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:26: error: 'i' was not declared in this scope
   37 |     cout<<pp[0].first+pp[i].second<<endl;
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
const double pi=3.14159265358979323846;
int ctoi(const char c) {
    if ('0' <= c && c <= '9') return (c - '0');
    return -1;
}
vector<int> input(int n) {
    vector<int> vec(n);
    for (int i = 0; i < n; i++) {
        cin >> vec.at(i);
    }
    return vec;
}
void output(vector<int> vec) {
    for (int i = 0; i < vec.size(); i++) {
        cout << vec[i] << " ";
    }
    return;
}
vector<vector<int>> input(int n, int m) {
    vector<vector<int>> table(n, vector<int>(m));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cin >> table. at(i).at(j);
        }
    }
    return table;
}
void output(vector<vector<int>> table) {
    for (int i = 0; i < table.size(); i++) {
        for (int j = 0; j < table.at(0).size(); j++) {
            cout << table.at(i).at(j) << " ";
        }
        cout << endl;
    }
}
long long perm(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long perm = 1;
    for (int i = n; i > n - r; i--) {
        perm *= i;
    }
    return perm;
}
long long comb(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long comb = perm(n,r);
    for (int i = r; i > 0; i--) {
        comb /= i;
    }
    return comb;
}
long long homo(int n, int r) {
    return comb(n + r - 1, n - 1);
}
long long fact(int n) {
    long long fact = 1;
    for (int i = n; i > 0; i--) {
        fact *= i;
    }
    return fact;
}
int gcd(int a, int b){
    if (a % b == 0){
        return(b);
    }else{
        return(gcd(b, a % b));
    }
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
bool isprime(int n){
    if (n < 2) return false;
    else if (n == 2) return true;
    else if (n % 2 == 0) return false;

    for (int i = 3; i <= sqrt(n); i += 2){
        if (n % i == 0){
            return false;
        }
    }
    return true;
}
void sayYes(bool f) {
    if (f) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}
void sayYES(bool f) {
    if (f) {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }
}

int main() {
  int n;
  cin >> n;
  vector<int> a(n),b(n);
  rep(i,n){
    cin >> a[i] >> b[i];
  }
  int maxa=0;ans;
  rep(i,n){
    if(maxa<a[i]){
      maxa=a[i];
      ans=a[i]+b[i];
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:118:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
  118 |   int maxa=0;ans;
      |              ^~~
      |              abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){int n;cin>>n;vector<pair<int,int>> vec(n);for(i=0;i<n;i++){cin>>vec[i].first>>vec[i].second;}sort(vec.rbegin(),vec.rend());cout<<vec[0].first+vec[0].second<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:58: error: 'i' was not declared in this scope
    3 | int main(){int n;cin>>n;vector<pair<int,int>> vec(n);for(i=0;i<n;i++){cin>>vec[i].first>>vec[i].second;}sort(vec.rbegin(),vec.rend());cout<<vec[0].first+vec[0].second<<endl;}
      |                                                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
  ll n;
  cin >> n;
  vector<P> p(n);
  rep(i,n){
    cin >> p[i].first >> p[i].second;
  }
  sort(p[i].begin(),p[i].end());
  cout << p[n-1].first+p[n-1].second << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: 'i' was not declared in this scope
   22 |   sort(p[i].begin(),p[i].end());
      |          ^
Language: C++

#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int (i) = 1; (i) <= (n); (i++))
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
#define print(x) cout << (x) << endl;
#define printa(x, n) for(ll i = 0; i < n; i++) {cout << (x[i]) << " ";} cout << endl;
#define printd(x) printf("%.12f\n", ans);
#define Yes() cout << "Yes" << endl;
#define No() cout << "No" << endl;
#define YES() cout << "YES" << endl;
#define NO() cout << "NO" << endl;
template<class T> bool chmin(T& a, const T& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b) {if (a < b) {a = b; return 1;} return 0;}
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;

int main(void) {
    int n;
    cin >> n;
    int _min = 1e9 + 7, _minIdx;
    rep (i, n) {
        int a, b;
        cin >> a >> b;
        if (b < _min) {
            chmin(_min, b)
            _minIdx = a;
        }
    }
    
    cout << _minIdx + _min << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:27: error: expected ';' before '_minIdx'
   35 |             chmin(_min, b)
      |                           ^
      |                           ;
   36 |             _minIdx = a;
      |             ~~~~~~~
Language: C++

using namespace std;
 #include <vector>
#include <math.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <iomanip>
#include <deque>
#include <map>

typedef long long ll;
#define rep(i, a, n) for(int i = a; i<n; i++)
#define ALL(a) begin(a), end(a)
#define mii map<int, int>
#define msi map<string, int>
#define vi vector<int>
#define vl vector<ll>
#define MOD 1000000007
#define INF 1e9
#define showVector(v) rep(i,0,v.size()){p(v[i]);p(” “)} pl(“”)
#define p(s) std::cout << s ;
#define pl(s)  std::cout << s << endl;
using namespace std;

// 素数判定 O(√n)
bool is_prime(int n){
    for(int i = 2; i * i <= n; i++){
        if(n % i == 0) return false;
    }
    return true;
}

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

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

   
int main() {
    ll n;
ll res = INF;
ll ans = 0;
cin >> n;
    for(ll i=0; i<n; i++){c
       ll a, b;
    cin >> a >> b;
   if(chmin(res, b)) {
        ans = a+b;
    }
}


        cout << ans << endl;
    return 0;
}


Compiler output:
a.cc:21:51: error: extended character ” is not valid in an identifier
   21 | #define showVector(v) rep(i,0,v.size()){p(v[i]);p(” “)} pl(“”)
      |                                                   ^
a.cc:21:53: error: extended character “ is not valid in an identifier
   21 | #define showVector(v) rep(i,0,v.size()){p(v[i]);p(” “)} pl(“”)
      |                                                     ^
a.cc:21:60: error: extended character “ is not valid in an identifier
   21 | #define showVector(v) rep(i,0,v.size()){p(v[i]);p(” “)} pl(“”)
      |                                                            ^
a.cc:21:60: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:56:27: error: 'c' was not declared in this scope
   56 |     for(ll i=0; i<n; i++){c
      |                           ^
a.cc:58:12: error: 'a' was not declared in this scope
   58 |     cin >> a >> b;
      |            ^
a.cc:58:17: error: 'b' was not declared in this scope
   58 |     cin >> a >> b;
      |                 ^
Language: C++

using namespace std;
 #include <vector>
#include <math.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <iomanip>
#include <deque>
#include <map>

typedef long long ll;
#define rep(i, a, n) for(int i = a; i<n; i++)
#define ALL(a) begin(a), end(a)
#define mii map<int, int>
#define msi map<string, int>
#define vi vector<int>
#define vl vector<ll>
#define MOD 1000000007
#define INF 1e9
#define showVector(v) rep(i,0,v.size()){p(v[i]);p(” “)} pl(“”)
#define p(s) std::cout << s ;
#define pl(s)  std::cout << s << endl;
using namespace std;

// 素数判定 O(√n)
bool is_prime(int n){
    for(int i = 2; i * i <= n; i++){
        if(n % i == 0) return false;
    }
    return true;
}

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

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

   
int main() {
    ll n;
ll res = INF;
ll ans = 0;
cin >> n;
    for(int i=0; i<n; i++){c
       ll a, b;
    cin >> a >> b;
   if(chmin(res, b)) {
        ans = a+b;
    }
}


        cout << ans << endl;
    return 0;
}


Compiler output:
a.cc:21:51: error: extended character ” is not valid in an identifier
   21 | #define showVector(v) rep(i,0,v.size()){p(v[i]);p(” “)} pl(“”)
      |                                                   ^
a.cc:21:53: error: extended character “ is not valid in an identifier
   21 | #define showVector(v) rep(i,0,v.size()){p(v[i]);p(” “)} pl(“”)
      |                                                     ^
a.cc:21:60: error: extended character “ is not valid in an identifier
   21 | #define showVector(v) rep(i,0,v.size()){p(v[i]);p(” “)} pl(“”)
      |                                                            ^
a.cc:21:60: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:56:28: error: 'c' was not declared in this scope
   56 |     for(int i=0; i<n; i++){c
      |                            ^
a.cc:58:12: error: 'a' was not declared in this scope
   58 |     cin >> a >> b;
      |            ^
a.cc:58:17: error: 'b' was not declared in this scope
   58 |     cin >> a >> b;
      |                 ^
Language: C++

#include<bits/stdc++.h>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define ll long long

using namespace std;

int main(){
  int n;cin>>n;
  vector<int> ab(n);
  rep(i,n)ab[i]=0;
  result = 0;

  rep(i,n){
    int a,b;cin>>a>>b;
    result = max(result, a+b);
  }

  cout<<result;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'result' was not declared in this scope
   12 |   result = 0;
      |   ^~~~~~
Language: C++

#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;
typedef long long ll;
#define REP(i,n) for (int i = 0; i < n; i++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;

int main ()
{
    int N; cin >> N;
    int ans = 0;
    int min_d = 1e9 + 1;
    REP(i,N) {
        int A,B;
        cin >> A >> B;
        if (max_d > B) {
            max_d = B;
            ans = A + B;
        }
    }

    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: 'max_d' was not declared in this scope
   34 |         if (max_d > B) {
      |             ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;
  vector<pair<int,int>>a(n);for(int i=0;i<n;i++)cin>>s.at(i).first>>s.at(i).second;
  sort(a.begin(),a.end());
  cout<<a.at(n-1).first+a.at(n-1).second<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:54: error: 's' was not declared in this scope
    5 |   vector<pair<int,int>>a(n);for(int i=0;i<n;i++)cin>>s.at(i).first>>s.at(i).second;
      |                                                      ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n),b(n),c(n);
  for(int i=0;i<n;i++){
    cin >> a.at(i) >> b.at(i);
    c.at(i) = a.at(i);
  }
  sort(c.begin(),c.end());
  int k;
  for(int i=0;i<n;i++){
    if(a.at(i) == c.at(n-1)){
      k = i;
      break;
    }
  }
  int ans = b.at(k) + i;
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:23: error: 'i' was not declared in this scope
   20 |   int ans = b.at(k) + i;
      |                       ^
Language: C++

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

int main(){
  int n,a,b;
  cin>>n>>a>>b;
  for(int i=1;i<n;i++){
    int x,y;
    cin>>x>>y;
    if(x>a){
      a=x; b=y;
    }
  }
  cout<<a+y<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'y' was not declared in this scope
   14 |   cout<<a+y<<endl;
      |           ^
Language: C++

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

int main(){
  int n; cin>>n;
  pair<long long ,long long> ab[n];
  for(int i=0;i<n;i++){
    long long a,b;
    cin>>a >>b;
    ab[i]=make_pair(a,b);
  }
  
  sort(ab.rbegin(),ab.rend());
  
  cout<<ab[0].first+ab[0].second<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: request for member 'rbegin' in 'ab', which is of non-class type 'std::pair<long long int, long long int> [n]'
   13 |   sort(ab.rbegin(),ab.rend());
      |           ^~~~~~
a.cc:13:23: error: request for member 'rend' in 'ab', which is of non-class type 'std::pair<long long int, long long int> [n]'
   13 |   sort(ab.rbegin(),ab.rend());
      |                       ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
 　long long n,a,b,max_a=0,ans=0;
  cin >> n;
  for(int i=0; i<n; i++) {
    cin >> a >> b;
    if(a>max_a) {
      max_a=a;
      ans=a+b;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc:6:2: error: extended character 　 is not valid in an identifier
    6 |  　long long n,a,b,max_a=0,ans=0;
      |  ^
a.cc: In function 'int main()':
a.cc:6:2: error: '\U00003000long' was not declared in this scope; did you mean 'ulong'?
    6 |  　long long n,a,b,max_a=0,ans=0;
      |  ^~~~~~
      |  ulong
a.cc:7:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |   cin >> n;
      |          ^
      |          yn
a.cc:9:12: error: 'a' was not declared in this scope
    9 |     cin >> a >> b;
      |            ^
a.cc:9:17: error: 'b' was not declared in this scope
    9 |     cin >> a >> b;
      |                 ^
a.cc:10:10: error: 'max_a' was not declared in this scope
   10 |     if(a>max_a) {
      |          ^~~~~
a.cc:12:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |       ans=a+b;
      |       ^~~
      |       abs
a.cc:15:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;cin>>N;
  vector<pair<int,int>> a(N);
  for(int i=0;i<N;i++)cin>>a.at(i).first>>a.at(i).second;
  sort(a.begin(),a.end(),greater<pair>());
  
  cout<<a.at(0).first+a.at(0).second<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:38: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::greater'
    7 |   sort(a.begin(),a.end(),greater<pair>());
      |                                      ^
a.cc:7:38: note:   expected a type, got 'pair'
Language: C++

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


int main(){
    int n; cin >> n;
    map<int, int> mp;

    int maxv = 0;
    for(int i=0; i<n; i++){
        int a, b; cin >> a >> b;
        maxv = max(maxv, a);
        mp[a] = 5;
    }

    cout << a + mp[a] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'a' was not declared in this scope
   17 |     cout << a + mp[a] << endl;
      |             ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
using namespace std;
#define int long long
#define double long double
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007 // 10^9+7
#define INF 99999999999 //10^12-1
#define P pair<int,int>
#define prique priority_queue
int n;
vector<P>vec;
signed main(){
    cin>>n;
    rep(i,n){
        int a,b;
        cin>>a>>b;
        P p=make_pair(a,b);
        vec.push_back(p);
    }
    sort(vec.begin(),vec.end());
    int ans=vec[n-1].first+vec[n-1].second;
    cout<<ans<<endl;
    return 0;
}

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

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>

#define _CRT_SECURE_NO_WARNINGS
#define TLong long long 

typedef struct {
	TLong a;	// rate
	TLong b;	// point
} score;

// fact(n)
int fact(int n){
	if(n == 1)	return 1;
	else return (n * fact(n - 1));
}

// combination(n,r)
int combination(int n, int r){
	if(r == 0 || r == n)	return 1;
	else if(r == 1)	return n;
	return (combination(n - 1, r - 1) + combination(n - 1, r));
}

int gcd(int a,int b){
	if(!(a % b)) return b;
	return gcd(b,a % b);
}

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

// qsort(array, size, sizeof(int),comp);
int comp(const void *p,const void *q){
    return ((store *)p)->a - ((store*)q)->a;
}

// append(array,*size,addNum)
void append(int *array,int *size,int num){
	realloc(array, sizeof(int) * (*size + 1));
	array[(*size)] = num;
	++(*size);
}

// pop(array,*size) & nongetpop(array,*size)
int pop(int *array,int *size){
	int temp = array[(*size - 1)];
	nongetpop(array,&(*size));
	return temp;
}

void nongetpop(int *array,int *size){
	realloc(array,sizeof(int) * (*size - 1));
	--(*size);
}

int main(int argc, char const *argv[]){
	int n;
	score *sc;
	scanf("%d",&n);
	sc = (score *)malloc(sizeof(score) * n);
	for (int i = 0; i < n; ++i)	scanf(" %d%d",&sc[i].a,&sc[i].b);
	qsort(sc,n,sizeof(score),comp);
	printf("%d\n", (sc[n - 1].a + sc[n - 1].b));
	return 0;
}


Compiler output:
main.c: In function 'comp':
main.c:40:14: error: 'store' undeclared (first use in this function); did you mean 'score'?
   40 |     return ((store *)p)->a - ((store*)q)->a;
      |              ^~~~~
      |              score
main.c:40:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:40:21: error: expected expression before ')' token
   40 |     return ((store *)p)->a - ((store*)q)->a;
      |                     ^
main.c:40:38: error: expected expression before ')' token
   40 |     return ((store *)p)->a - ((store*)q)->a;
      |                                      ^
main.c: In function 'pop':
main.c:53:9: error: implicit declaration of function 'nongetpop' [-Wimplicit-function-declaration]
   53 |         nongetpop(array,&(*size));
      |         ^~~~~~~~~
main.c: At top level:
main.c:57:6: warning: conflicting types for 'nongetpop'; have 'void(int *, int *)'
   57 | void nongetpop(int *array,int *size){
      |      ^~~~~~~~~
main.c:53:9: note: previous implicit declaration of 'nongetpop' with type 'void(int *, int *)'
   53 |         nongetpop(array,&(*size));
      |         ^~~~~~~~~
main.c: In function 'append':
main.c:45:9: warning: ignoring return value of 'realloc' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |         realloc(array, sizeof(int) * (*size + 1));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c: In function 'nongetpop':
main.c:58:9: warning: ignoring return value of 'realloc' declared with attribute 'warn_unused_result' [-Wunused-result]
   58 |         realloc(array,sizeof(int) * (*size - 1));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

int main()
{
    int N;
    cin >> N;
    ll max = 0;
    ll n = 0;
    REP(i, N)
    {
        ll A, B;
        cin >> A >> B;
        if (max < A)
        {
            max = A;
            n = B;
        }
    }
    cout << min + n << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:17: error: invalid operands of types '<unresolved overloaded function type>' and 'll' {aka 'long long int'} to binary 'operator+'
   30 |     cout << min + n << endl;
      |             ~~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<pair<int,int>> v(n);
  for(int i=0;i<n;++i)cin>>v[i].f>>v[i].s;
  sort(v.begin(),v.end());
  cout<<v[n-1].first+v[n-1].second<<"\n";
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:33: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'f'
    7 |   for(int i=0;i<n;++i)cin>>v[i].f>>v[i].s;
      |                                 ^
a.cc:7:41: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 's'
    7 |   for(int i=0;i<n;++i)cin>>v[i].f>>v[i].s;
      |                                         ^
Language: C

#include<stdio.h>
#include<string.h>
int main() {
	long long int n,max=0,a[200000],b[200000],number;
	scanf("%lld", &n);
	
	for (int i = 1; i <= h; i++) {
		scanf("%lld%lld", &a[i],&b[i]);
		if (max < a[i]) { number = b[i];max=a[i] }
	}
	printf("%lld", max + number );
}


Compiler output:
main.c: In function 'main':
main.c:7:30: error: 'h' undeclared (first use in this function)
    7 |         for (int i = 1; i <= h; i++) {
      |                              ^
main.c:7:30: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:57: error: expected ';' before '}' token
    9 |                 if (max < a[i]) { number = b[i];max=a[i] }
      |                                                         ^~
      |                                                         ;
Language: C

#include<stdio.h>
#include<string.h>
int main() {
	long long int n,max=0,a[200000],b[200000],number;
	scanf("%lld", &n);
	
	for (int i = 1; i <= h; i++) {
		scanf("%lld%lld", &a[i],&b[i]);
		if (max < a[i]) { number = b[i]; }
	}
	printf("%lld", a[i] + b[i] );
}

Compiler output:
main.c: In function 'main':
main.c:7:30: error: 'h' undeclared (first use in this function)
    7 |         for (int i = 1; i <= h; i++) {
      |                              ^
main.c:7:30: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:26: error: 'i' undeclared (first use in this function)
   11 |         printf("%lld", a[i] + b[i] );
      |                          ^
Language: C++

maxx = 2**29
ans = 0
for _ in range(int(input())):
    a, b = map(int, input().split(' '))
    if b < maxx:
        maxx = b
        ans = a
print(ans + maxx)


Compiler output:
a.cc:1:1: error: 'maxx' does not name a type
    1 | maxx = 2**29
      | ^~~~