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

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


int main()
{
  	int A, B, answer;
	cin >> A >> B;
	answer = 0;
	if (A >= B){
		answer += A;
		A -= 1;
	}
	else{
		answer += B;
		B -= 1;
	}
	
	if (A >= B){
		answer += A;
		A -= 1;
	}
	else{
		answer += B;
		B -= 1;
	}
	cout << answer << endl;
	}
	return 0;
}

Compiler output:
a.cc:29:9: error: expected unqualified-id before 'return'
   29 |         return 0;
      |         ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

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

int main() {
  int A, B; cin >> A >> B;
  int coin;
  for( int i = 0; i++; i < 2 ) {
    if( A >= B )
      coin += A;
      A--;
    else
      coin += B;
      B--;
  }
  cout << coin << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'else' without a previous 'if'
   11 |     else
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
        int A,B;
        cin>>A>>B;
        int answer=0;

        if(A>B){
        answer=answer+A;
        A=A-1;
        }else{
        answer=answer+B;
        B=B-1;
        }
         if(A>B){
        answer=answer+A;
        A=A-1;
        }else{
        answer=answer+B;
        B=B-1;
        }


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

#include <iostream>
#include <cstdlib>
#include <vector>
#include <string>
using namespace std;

int main()
{
    int a,b;
    cin >> a >> b;
    cout << max({a+b,2*a-1,2*b-1});
    
}

long long kiriagewarizan(long long n,long long m){
    long long kotae = n/m;
    if (n%m != 0){kotae++;}
    return kotae;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   11 |     cout << max({a+b,2*a-1,2*b-1});
      |             ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
Language: C

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

int main(){
  int x, y;
  cin >> x >> y;
  int a;
  a = max(x, y);
  cout << a*2 -1 << endl;
  return 0;
}

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

#include "bits/stdc++.h"

// ============================ Header  =================================


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

	ll a, b;
	cin >> a >> b;
	if (a == b) {
		cout << a + a;
	}
	else {
		cout << max(a, b) + (max(a, b) - 1);
	}
	return 0;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin.tie(0);
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:9: error: 'ios' has not been declared
    8 |         ios::sync_with_stdio(false);
      |         ^~~
a.cc:10:9: error: 'll' was not declared in this scope
   10 |         ll a, b;
      |         ^~
a.cc:11:16: error: 'a' was not declared in this scope
   11 |         cin >> a >> b;
      |                ^
a.cc:11:21: error: 'b' was not declared in this scope
   11 |         cin >> a >> b;
      |                     ^
a.cc:13:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |                 cout << a + a;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |                 cout << max(a, b) + (max(a, b) - 1);
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:25: error: 'max' was not declared in this scope; did you mean 'std::max'?
   16 |                 cout << max(a, b) + (max(a, b) - 1);
      |                         ^~~
      |                         std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include <iostream>

using namespace std;

int main(void){
    int a,b;
    cin >> a >> b;
    if(a == b){
        cout << a+b << endl; 
    }else if(a < b){
        cout << b+b-1; << endl;
    }else{
        cout << a+a-1 << endl
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: expected primary-expression before '<<' token
   11 |         cout << b+b-1; << endl;
      |                        ^~
a.cc:13:30: error: expected ';' before '}' token
   13 |         cout << a+a-1 << endl
      |                              ^
      |                              ;
   14 |     }
      |     ~
Language: C++

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

int main(){
 cin>>a>>b;
  cout<<max(2*a,max(2*b,a+b))  <<endl;
  
}



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

#include <bits/stdc++.h> 

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a,b,c;
    cin>>a>>b;
    if(a==b)
      cout<<2*a<<endl;
    else {
      c=max(a,b)
      cout<<2*c-1<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: expected ';' before 'cout'
   13 |       c=max(a,b)
      |                 ^
      |                 ;
   14 |       cout<<2*c-1<<endl;
      |       ~~~~
Language: C++

#include <stdio.h>
#include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
#include<complex>
#include<vector>

using namespace std;

int nx[]={0,1,0,-1};
int ny[]={0,1,0,-1};
//*****************************************


int main(void){

    int a,b,c;
    scanf("%d",&a);
    scanf("%d",&b);

    int max=max({a*2-1,a+b,b*2-1});

    cout << max<<endl;

    return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: 'max' cannot be used as a function
   22 |     int max=max({a*2-1,a+b,b*2-1});
      |             ~~~^~~~~~~~~~~~~~~~~~~
Language: C++

// Undone
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections;
public class Program {
  public static void Main() {
    int A = cin(), B = cin();
    int ans = Math.Max(A,B) + Math.Max(Math.Min(A,B), Math.Max(A,B)-1);
    Console.WriteLine(ans);
  }

  private static List<int> _var;
  public static int cin() { if (_var == null || _var.Count() == 0) { _var = Console.ReadLine().Split(' ').Select(int.Parse).ToList<int>(); } int ans = _var[0]; _var.RemoveAt(0); return ans; }
  public static void Swap<T>(ref T a, ref T b) {T temp = a;a = b;b = temp;}
  public static string ReadStr() { return Console.ReadLine(); }
  public static int ReadInt() { return int.Parse(Console.ReadLine()); }
  public static double ReadDouble() { return double.Parse(Console.ReadLine()); }
  public static long ReadLong() { return long.Parse(Console.ReadLine()); }
  public static char ReadChar() { return Console.ReadLine()[0]; }
  public static string[] ReadStringArray() { return Console.ReadLine().Split(' '); }
  public static int[] ReadIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
  public static double[] ReadDoubleArray() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
  public static long[] ReadLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
  public static char[] ReadCharArray() { return Console.ReadLine().ToArray(); }
  public static string[] ReadCharStringArray() { return Console.ReadLine().ToCharArray().Select(c => c.ToString()).ToArray(); }
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Collections;
      |       ^~~~~~
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class Program {
      | ^~~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
 
int main(void){
	int A,B;
	int i;
	int s;
 
	scanf("%d %d", &A, &B);

	for(i=0; i < 2; i++){
		if(A >= B){
			s += A--;
		}else{
			s -= B--
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:33: error: expected ';' before '}' token
   16 |                         s -= B--
      |                                 ^
      |                                 ;
   17 |                 }
      |                 ~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: no matching function for call to 'max(int)'
    9 |         cout << max(c+max(a-1,b-1)) << endl;
      |                 ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
a.cc:9:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    9 |         cout << max(c+max(a-1,b-1)) << endl;
      |                 ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<iostream>
#include<algorithm>

int main(){
	int a,b;
  	if(a>b)cout<<2*a-1<<endl;
  	else if(a==b)cout<<2*a<<endl;
  	else if(a<b)cout<<2*b-1<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |         if(a>b)cout<<2*a-1<<endl;
      |                ^~~~
      |                std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |         if(a>b)cout<<2*a-1<<endl;
      |                             ^~~~
      |                             std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:7:22: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |         else if(a==b)cout<<2*a<<endl;
      |                      ^~~~
      |                      std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |         else if(a==b)cout<<2*a<<endl;
      |                                 ^~~~
      |                                 std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:8:21: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |         else if(a<b)cout<<2*b-1<<endl;
      |                     ^~~~
      |                     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:8:34: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |         else if(a<b)cout<<2*b-1<<endl;
      |                                  ^~~~
      |                                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int A,B;

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

	cin >> A >> B;

	for(i,2){
		if(A>B){
			ans += A;
			A--;
		}else{
			ans += B;
			B--;
		}
	}

	cout << ans << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'i' was not declared in this scope
   15 |         for(i,2){
      |             ^
a.cc:28:1: error: expected primary-expression before '}' token
   28 | }
      | ^
a.cc:25:29: error: expected ')' before '}' token
   25 |         cout << ans << endl;
      |                             ^
      |                             )
......
   28 | }
      | ~                            
a.cc:15:12: note: to match this '('
   15 |         for(i,2){
      |            ^
a.cc:28:1: error: expected primary-expression before '}' token
   28 | }
      | ^
Language: C++

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

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

    int ans;
    ans=max(a+b,2a-1);
    ans=max(ans,2b-1);

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: unable to find numeric literal operator 'operator""a'
    9 |     ans=max(a+b,2a-1);
      |                 ^~
a.cc:10:17: error: unable to find numeric literal operator 'operator""b'
   10 |     ans=max(ans,2b-1);
      |                 ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,but;
    cin >> a >> b;
    if(a>b){
        but = a;
        a--1;
    }else{
        but = b;
        b--;
    }
    if(a>b){
        but = but + a;
        a--1;
    }else{
        but = but + b;
        b--;
    }
    cout << but << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before numeric constant
    8 |         a--1;
      |            ^
      |            ;
a.cc:15:12: error: expected ';' before numeric constant
   15 |         a--1;
      |            ^
      |            ;
Language: C++



#include <iostream>
#include <cmath>

using namespace std;

int main() {
  int N[2];
  cin >> N[0] >> N[1];

  int sum = 0;
  sort(N, N+2);
  sum += N[1]--;
  sort(N, N+2);
  sum += N[1]--;




  cout << sum << endl;

  return 0;
}

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: no matching function for call to 'max(int)'
    9 |         cout << max(c+max(a-1,b-1))) << endl;
      |                 ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
a.cc:9:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    9 |         cout << max(c+max(a-1,b-1))) << endl;
      |                 ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

//
//  atcoder.cpp
//
//
///
#include <bits/stdc++.h>
#define REP(i, N) for(int i=0; i<N; i++)
using namespace std;

//#include "atcoder.hpp"

long long gcd(long long a, long long b) {
    if (a>b) swap(a,b);
    
    auto r = b % a;
    
    return (r ? gcd(r, a) : a);
}

int main() {
    long long A,B;
    
    cin >> A >> B;
    
    if (B > A)
    swap(A,B);

    cout << (A == B) ? A * 2 : A + (A - 1) << endl;
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:44: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   28 |     cout << (A == B) ? A * 2 : A + (A - 1) << endl;
      |                                ~~~~~~~~~~~~^~~~~~~
Language: C

a,b = list(map(int, input().split()))
if a > b:
    print(a + a - 1)
elif a == b:
    print(2 * a)
else:
    print(b + b - 1)


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | a,b = list(map(int, input().split()))
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
    1 | a,b = list(map(int, input().split()))
      |   ^
main.c:1:7: error: implicit declaration of function 'list' [-Wimplicit-function-declaration]
    1 | a,b = list(map(int, input().split()))
      |       ^~~~
main.c:1:12: error: implicit declaration of function 'map' [-Wimplicit-function-declaration]
    1 | a,b = list(map(int, input().split()))
      |            ^~~
main.c:1:16: error: expected expression before 'int'
    1 | a,b = list(map(int, input().split()))
      |                ^~~
main.c:2:1: error: expected ',' or ';' before 'if'
    2 | if a > b:
      | ^~
Language: C++

#include<math.h>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;

#include<cstdio>

#define FOR(i, n) for(int i = 0; i < (n); i++)
#define FORq(i, m, n) for(int i = (m); i < (n); i++)
#define FORr(i, n) for (int i = (n); i >= 0; i++)


int main() {
	int A, B;
	cin >> A >> B;
	if (abs(A - B) >= 2) {
		cout << max(A, B) * 2 - 1 << endl;
	}
	else {
		cout << A + B << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'cin' was not declared in this scope
   16 |         cin >> A >> B;
      |         ^~~
a.cc:8:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    7 | #include<cstdio>
  +++ |+#include <iostream>
    8 | 
a.cc:18:17: error: 'cout' was not declared in this scope
   18 |                 cout << max(A, B) * 2 - 1 << endl;
      |                 ^~~~
a.cc:18:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:46: error: 'endl' was not declared in this scope
   18 |                 cout << max(A, B) * 2 - 1 << endl;
      |                                              ^~~~
a.cc:8:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    7 | #include<cstdio>
  +++ |+#include <ostream>
    8 | 
a.cc:21:17: error: 'cout' was not declared in this scope
   21 |                 cout << A + B << endl;
      |                 ^~~~
a.cc:21:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:34: error: 'endl' was not declared in this scope
   21 |                 cout << A + B << endl;
      |                                  ^~~~
a.cc:21:34: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <iostream>
using namespace std;
int main(){
  int A, B;
  cin>>A>>B;
  int coin = 0;
  if(A>=B){
    coin+=A;
    A-=1
  }
  else{
    coin+=B;
    B-=1
  }
  if(A>=B){
    coin+=A;
    A-=1
  }
  else{
    coin+=B;
    B-=1
  }
  cout<<coin;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: expected ';' before '}' token
    9 |     A-=1
      |         ^
      |         ;
   10 |   }
      |   ~      
a.cc:13:9: error: expected ';' before '}' token
   13 |     B-=1
      |         ^
      |         ;
   14 |   }
      |   ~      
a.cc:17:9: error: expected ';' before '}' token
   17 |     A-=1
      |         ^
      |         ;
   18 |   }
      |   ~      
a.cc:21:9: error: expected ';' before '}' token
   21 |     B-=1
      |         ^
      |         ;
   22 |   }
      |   ~
Language: C++

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

int main(){
  int A,B;
  cin >> A >> B;
  int max_num;
  int counter = 0;

  for(i = 0;i < 2;i++){
    max_num=max(A,B);
    counter += max_num;
    if(max_num == A) A -= 1;
    else B -= 1;
  }

  cout << counter << endl;
}

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

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

int n,m,res;

int main()
{
	ios::sync_with_stdio(false);
	cin>>n>>m;
	if(n>m) res+=n,n--;
	else res+=m,m--; 
	if(n>m) res+=n,n--;
	else res+=m,m--; 
	cout<<res<<endl;5 4
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:26: error: expected ';' before numeric constant
   17 |         cout<<res<<endl;5 4
      |                          ^~
      |                          ;
Language: C

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

#define MOD 998244353

#define MIN(a,b) ((a)<(b)?(a):(b));
#define MAX(a,b) ((a)>(b)?(a):(b));

typedef long long int64;

int main(void){
    int A,B;
    scanf("%d %d",&A,&B);
    if(A==B) printf("%d",A*2);
    else printf("%d",MAX(A,B)*2-1);
    
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:35: error: expected ')' before ';' token
   10 | #define MAX(a,b) ((a)>(b)?(a):(b));
      |                                   ^
main.c:18:22: note: in expansion of macro 'MAX'
   18 |     else printf("%d",MAX(A,B)*2-1);
      |                      ^~~
main.c:18:16: note: to match this '('
   18 |     else printf("%d",MAX(A,B)*2-1);
      |                ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int A,B;
  int count=0;
  cin >> A >> B;
  if(A>B){
    count+=A;
    A--;
  }else{
    count+=B;
    B--;
  }
  if(A>B){
    count+=A;
    A--;
  }else{
    count+=B;
    B--;
  }
  cout << count << endl;

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

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



void solve(){
  int a,b;
  cin >> a >> b;
  if (a!=B) cout << 2*max(a,b) -1 << endl;
  else cout << 2*a << endl;
}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:11:10: error: 'B' was not declared in this scope
   11 |   if (a!=B) cout << 2*max(a,b) -1 << endl;
      |          ^
Language: C++

#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main() {
	ll a,b;
	cin>>a>>b;
	scout << max(a+b,max(a+a-1,b+b-1)) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'scout' was not declared in this scope; did you mean 'stdout'?
   42 |         scout << max(a+b,max(a+a-1,b+b-1)) << endl;
      |         ^~~~~
      |         stdout
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;cin>>a>>b;
int ans=0;
for(int i=0;i<2;i++){
  if(a>b) {
      ans+=a;
      a--;
  }
  else{
      asn+=b;
      b--;
  }
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'asn' was not declared in this scope; did you mean 'ans'?
   12 |       asn+=b;
      |       ^~~
      |       ans
Language: C++

#include <iostream>
using namespace std;

int main() 
{
	int a, b;
	cin >> a >> b;
	cout << max(2*a - 1, 2*b - 1, a + b);
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: assignment of read-only location 'std::max<int>(a, b)'
    8 |   max(a, b) -= 1;
      |   ~~~~~~~~~~^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: decrement of read-only location 'std::max<int>(a, b)'
    8 |   max(a, b)--;
      |   ~~~^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int a,b;cin>>a>>b;
  if(a==b)cout<<a+b<<endl;
  else cout<<max(a,b)+max(a+b)-1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: no matching function for call to 'max(int)'
    7 |   else cout<<max(a,b)+max(a+b)-1<<endl;
      |                       ~~~^~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
a.cc:7:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    7 |   else cout<<max(a,b)+max(a+b)-1<<endl;
      |                       ~~~^~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <iostream>

using namespace std;
int a,b;
int main()
{
    cin>>a>>b;
    cout<<max((a+a-1),max((b+b-1),(a+b-1)));53
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:47: error: expected ';' before 'return'
    8 |     cout<<max((a+a-1),max((b+b-1),(a+b-1)));53
      |                                               ^
      |                                               ;
    9 |     return 0;
      |     ~~~~~~
Language: C++

//#pragma warning(disable : 4996)
#include<iostream>
#include<vector>
#include<algorithm>
#include<fstream>
#include<stdio.h>
#include<map>
#include<set>
#include<limits.h>
#include<list>
#include<sys/stat.h>
#include<direct.h>
#include<iosfwd>
//#include"require.h"
#include <cassert>
#include<sstream>
#include<iomanip>
#include<locale>
#include <bitset>
using namespace std;
using ll = long long int;

int main() {
	int n, ans = 0, max = 0,c;
	cin >> n;
	while (n--) {
		cin >> c;
		if (c >= max)
			ans++, max = c;
		
	}
	cout << ans;
	return 0;
} 





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

#pragma warning(disable : 4996)
#include<iostream>
#include<vector>
#include<algorithm>
#include<fstream>
#include<stdio.h>
#include<map>
#include<set>
#include<limits.h>
#include<list>
#include<sys/stat.h>
#include<direct.h>
#include<iosfwd>
//#include"require.h"
#include <cassert>
#include<sstream>
#include<iomanip>
#include<locale>
#include <bitset>
using namespace std;
using ll = long long int;

int main() {
	int n, ans = 0, max = 0,c;
	cin >> n;
	while (n--) {
		cin >> c;
		if (c >= max)
			ans++, max = c;
		
	}
	cout << ans;
	return 0;
} 





Compiler output:
a.cc:12:9: fatal error: direct.h: No such file or directory
   12 | #include<direct.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int main()
{
int n,ans;
  scanf("%d",&n);
  ans=1;
  int h[n],max[n];
  for(i=0;i<n;++i)
  {
  scanf("%d",&h[i]);
  }
  max[0]=h[0];
  for(i=0;i<n-1;++i)
  {
  if(max[i]<h[i+1]) {max[i+1]=h[i+1];
                    ans++;
                    }
  else max[i+1]=max[i];
  }
  
  for(i=0;i<n-1;++i)
  {
  if(max[i]<h[i+1]) max[i+1]=h[i+1];
  else max[i+1]=max[i];
  }

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:7: error: 'i' undeclared (first use in this function)
    8 |   for(i=0;i<n;++i)
      |       ^
main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

#define ll long long
#define endl "\n"

int main(){
  int n;
  cin >> n;
  int a[n];
  for(int i=0;i<n;i++)
    cin >> a[i];
  int ans=0;
  for(int i=1;i<n;i++){
    for(int j=0;j<i;j++){
      if(a[j]<=a[i]){
        f=1;
      }
      else{
      f=0;
      break;
      }
    }  
    if(f)
      ans++;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'f' was not declared in this scope
   17 |         f=1;
      |         ^
a.cc:20:7: error: 'f' was not declared in this scope
   20 |       f=0;
      |       ^
a.cc:24:8: error: 'f' was not declared in this scope
   24 |     if(f)
      |        ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  int h[n];
  for(int i=0;i<n;i++)
    cin >> h[i];
  int ans=1, flag=0;
  for(int i=1;i<n;i++){
    for(int j=0;j<i;j++){
      	if(a[j]<=a[i]){
          flag=1;
        }
      else{
      flag=0;
      break;
      }
    }
    if(flag)
      	ans++;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'a' was not declared in this scope
   13 |         if(a[j]<=a[i]){
      |            ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  int h[n];
  for(int i=0;i<n;i++)
    cin >> h[i];
  int ans=1;
  for(int i=1;i<n;i++){
    for(int j=0;j<i;j++){
      	if(a[j]<=a[i])
          	ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'a' was not declared in this scope
   13 |         if(a[j]<=a[i])
      |            ^
Language: C++

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

int main(){
  int N;
  cin>>N;
  int maxA=0;
  int cnt=0;
  for(int i=0;i<N;i++){
    cin>>A[i];
    maxA=max(maxA,A[i]);
    if(A[i]>=maxA){
      cnt++;
    }
  }
  cout<<cnt<<endl;
  return 0;
}


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

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

int main() {
  int N, ans, k;
  cin >> N;
  ans=1;
  vector<int> H(N);
  for (int i=0; i<N; i++) {
    cin >> H[i];
  }
  if (N>=2) {
    for (int j=1; j<N; j++) {
      k=0;
      for (int j=0; j<i; j++) {
        if (H[j]<=H[i]) {
          k=k+1;
        }
      }
      if (k==i) {
        ans=ans+1;
      }
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: 'i' was not declared in this scope
   18 |       for (int j=0; j<i; j++) {
      |                       ^
a.cc:23:14: error: 'i' was not declared in this scope
   23 |       if (k==i) {
      |              ^
Language: Java

import java.util.Scanner;

public class main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
Scanner SC = new Scanner(System.in);
int N = SC.nextInt();
int H [] = new int[N + 1];
for(int i = 0; i < N; i++) {
    H[i] = SC.nextInt();
}
int counter = 0;
for(int i = 0; i <= N; i++) {
	boolean cso = true;
	for(int j = 0; j <= N; i++) {
		if(H[j] > H[i]) {
			cso = false;
		}
	}
	if(cso) {
		counter++;
	}
}
System.out.println(counter);
	}

}


Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: C++



#include <bits/stdc++.h>
#include <string.h>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define r0 return 0
#define INF (int)1e15

int main(){

  long long n,x; 
 vector<int>v;

 for(int i=0;i<n;i++){
  cin>>x;
  v[i] = x;
 }

  int maxi=v[0],cnt=1;

  for(int i=1;i<n;i++){
     
     if(v[i] > maxi){
      cnt++;
      maxi = v[i]; }
  }

  cout<<ans<<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   37 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++


#include <bits/stdc++.h>
#include <string.h>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define r0 return 0
#define INF (int)1e15

int main(){

  long long n,x; 
 vector<int>v;

 for(int i=0;i<n;i++){
  cin>>x;
  v[i] = x;
 }

  int maxi=v[0],cnt=1;

  for(int i=1;i<n;i++){
     
     if(a[i] > maxi){
      cnt++;
      maxi = a[i]; }
  }

  cout<<ans<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'a' was not declared in this scope
   31 |      if(a[i] > maxi){
      |         ^
a.cc:36:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |   cout<<ans<<endl;
      |         ^~~
      |         abs
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 max=0;
      int count=0;
      for(int i=0;i<N;i++)
      {
        if(max<=temp)
        {
          count++;
          max=temp;
        }
      }
		System.out.println(count);
	}
}


Compiler output:
Main.java:12: error: cannot find symbol
        if(max<=temp)
                ^
  symbol:   variable temp
  location: class Main
Main.java:15: error: cannot find symbol
          max=temp;
              ^
  symbol:   variable temp
  location: class Main
2 errors
Language: C

#include<stdio.h>

int main(void)
{
  //nを入力	
  int n;
  scanf("%d",&n);

  int h[n],i,j,ans=1,cnt;
  scanf("%d",&h[0]);
  for(i=1;i<n;i++){
    scanf("%d",&h[i]);
    cnt=0;
    for(j=0;j<i;j++){
      if(h[j]>h[i])
        break;
      cnt++;
      }
    if(cnt>=i)
      ans++;
    }
  }

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

Compiler output:
main.c:24:10: error: expected declaration specifiers or '...' before string constant
   24 |   printf("%d\n",ans);
      |          ^~~~~~
main.c:24:17: error: unknown type name 'ans'
   24 |   printf("%d\n",ans);
      |                 ^~~
main.c:25:3: error: expected identifier or '(' before 'return'
   25 |   return 0;
      |   ^~~~~~
main.c:26:1: error: expected identifier or '(' before '}' token
   26 | }
      | ^
Language: C++

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

#define rep(i,a,b) for (int i = (a); i < (b); i++ )

int main() {
	int a;
	cin >> a;
	vector<int> h(a);
	rep(i, 0, a) {
		cin >> h.at(i);
	}

	int ans;
	ans = 0;
	for (int i = 1; i <a;i++) {
		if (h.at(0) <= h.at(i)) {
			if (h.at(1) <= h.at(i)&&h.at(i-1)<=h.at(i)){
				{
					ans++;
			}

		}
	}
	cout << ans << endl;
}


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

import java.util.Scanner;
public class Main {

		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int check = 0;
			int[] array = new int [n];
			int res = 0;
			for(int i = 0;i<n;i++) {
				array[i] = sc.nextInt();
			}
			for(int i = n-1;i>=0;i--) {
				for(int j = i-1;j>=0;j--) {
					if(array[i]>=array[j]) {
							check++;
						if(check>=j) {
							res++;
							check = 0;
						}
					}
				}	
			}
			System.out.println(res-1);
			sc.close();
		}
	public static void main(String[] args) {
		solve();

	}

Compiler output:
Main.java:30: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

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

int main() {
  int n;
  int h;
  int max = -1;
  int res = 0;
  for (int i = 0; i < n; i++) {
    cin >> h;
    if (max <= h) {
      res++;
    }
    max = max(max, h);
  }
  cout << res << endl;
}


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

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


int main() {
  int n;
  cin >> n;
  vector<int> h(n);
  rep(i,n) cin >> h[i];
  int count = 0;
  rep(i,n) {
    bool flag = true;
    rep(j,i){
      if(h[i]<h[j]) flag = false;
      break;
    }
    if(num) ++count;
  }
  cout << count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:8: error: 'num' was not declared in this scope; did you mean 'enum'?
   19 |     if(num) ++count;
      |        ^~~
      |        enum
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(i);
  }
  int ans=0;
  for(int i=0;i<N;i++){
    for(int j=0;j<i;j++){
      bool any=true;
      if(A(j)>A(i)){
        any=false;
        break;
      }
      if(any){
        ans++;
      }
    }
  }
  cout<<ans<<endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: no match for call to '(std::vector<int>) (int&)'
    9 |     cin>>A(i);
      |          ~^~~
a.cc:15:11: error: no match for call to '(std::vector<int>) (int&)'
   15 |       if(A(j)>A(i)){
      |          ~^~~
a.cc:15:16: error: no match for call to '(std::vector<int>) (int&)'
   15 |       if(A(j)>A(i)){
      |               ~^~~
Language: C++

<?php
  $n = trim(fgets(STDIN));
  $h = explode(" ",trim(fgets(STDIN)));
  $count = 1;
  $max = $h[0];
  for($i=1; $i<$n; $i++){
    if($max <= $h[$i]){
      $max = $h[$i];
      $count++;
    }
  }
  echo $count."\n";

Compiler output:
a.cc:1:1: error: expected unqualified-id before '<' token
    1 | <?php
      | ^
a.cc:3:3: error: '$h' does not name a type
    3 |   $h = explode(" ",trim(fgets(STDIN)));
      |   ^~
a.cc:4:3: error: '$count' does not name a type
    4 |   $count = 1;
      |   ^~~~~~
a.cc:5:3: error: '$max' does not name a type
    5 |   $max = $h[0];
      |   ^~~~
a.cc:6:3: error: expected unqualified-id before 'for'
    6 |   for($i=1; $i<$n; $i++){
      |   ^~~
a.cc:6:13: error: '$i' does not name a type
    6 |   for($i=1; $i<$n; $i++){
      |             ^~
a.cc:6:20: error: '$i' does not name a type
    6 |   for($i=1; $i<$n; $i++){
      |                    ^~
a.cc:12:3: error: 'echo' does not name a type
   12 |   echo $count."\n";
      |   ^~~~
Language: C

#include<stdio.h>
int main(){
  int N,H[20],cnt = 1;
  scanf("%d",&N);
  for(int i = 1;i<=N;i++){
    scanf("%d",H[i]);
  }
  for(int i = 3;i<=Ni++){
    for(int j = 2 ;j<=i-1;j++){
      if(H[j]<=H[i]){
        cnt ++;
      }
    }
  }
  printf("%d",cnt);
}
      
  
    


Compiler output:
main.c: In function 'main':
main.c:8:20: error: 'Ni' undeclared (first use in this function); did you mean 'i'?
    8 |   for(int i = 3;i<=Ni++){
      |                    ^~
      |                    i
main.c:8:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:24: error: expected ';' before ')' token
    8 |   for(int i = 3;i<=Ni++){
      |                        ^
      |                        ;
Language: C++

#include <iostream>
using namespace std;
int h[20];
int main()
{
  int n,br=0;
  cin >> n;
  for(int i=0;i<n;i++)
    cin>>h[i];
  max=0;
  for(int i=0;i<n;i++)
  {
    if(h[i]>max)
    {
      max=h[i];
      br=+1;
    }
  }
  cout << br;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: overloaded function with no contextual type information
   10 |   max=0;
      |       ^
a.cc:13:12: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>'
   13 |     if(h[i]>max)
      |        ~~~~^~~~
a.cc:15:14: error: overloaded function with no contextual type information
   15 |       max=h[i];
      |              ^
Language: C++

//testcode.cpp
#include <iostream>
using namespace std;

int main() {
    int N , counter;
    counter = 1;

    cin >> N;

    int arr[N];
    for(int i { 0 }; i < N; ++i){
        cin >> arr[i];
    }

    for(int i { 1 }; i < N; ++i){
        if (arr[i] >= arr[i - 1])
        {
            if (arr[i] >= arr[0])||(arr[i] >= arr[1])
                {
                  counter++;
                }
        }
    }
    cout << counter ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:34: error: expected primary-expression before '||' token
   19 |             if (arr[i] >= arr[0])||(arr[i] >= arr[1])
      |                                  ^~
Language: C

#include<stdio.h>
int main(void){
  int l,i,j,cnt=1;
  scanf("%d",%l);
  int mt[l];
  scanf("%d",&mt[0]);
  for(i=1;i<l;i++){
    if(mt[i-1]<mt[i]){
      cnt++;
    }
  }
  printf("%d",cnt);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:14: error: expected expression before '%' token
    4 |   scanf("%d",%l);
      |              ^