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

#include <iostream>
#include <cstdio>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)

int a[10];

//B:=B?????????????????° C*=C?????????????????° cnt:=??????????????°??????
bool dfs(int B, int C, int cnt){
	if(cnt == 10){
		return true;
	}
	if(B < a[cnt]){
		return dfs(a[cnt], C, cnt + 1);
	}
	if(C < a[cnt]){
		return dfs(B, a[cnt], cnt + 1);
	}
	if(B > a[cnt] && C > a[cnt]){
		return false;
	}
}
int main(void){
	int n; cin >> n;
	for (int i = 0; i < n; ++i){
		rep(j, 10) cin >> a[j];
		flag = false;
		dfs(0, 0, 0);
		if(flag) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'flag' was not declared in this scope
   28 |                 flag = false;
      |                 ^~~~
a.cc: In function 'bool dfs(int, int, int)':
a.cc:23:1: warning: control reaches end of non-void function [-Wreturn-type]
   23 | }
      | ^
Language: C++

#include <iostream>
#include <stack>
#include <vector>
#include <algorithm>
using namespace std;
static const int MAX_N = 10;
int a[MAX_N] = {0};

bool dfs(int a[],vector<int> r,vector<int> l,i){
	if(i==MAX_N)return true;
	if(r.size()==0 || r[r.size()-1]<a[i]){
		r.push_back(a[i]);
		return solve(a,r,l,i+1);
	}
	if(l.size()==0 || l[l.size()-1]<a[i]){
		l.push_back(a[i]);
		return solve(a,r,l,i+1);
	}
	return false;
}


int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		for(int j=0;j<10;j++){//input
			cin>>a[j];
		}
		vector<int> r;
		vector<int> l;
		if dfs(a,r,l,0){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
}

Compiler output:
a.cc:9:46: error: 'i' has not been declared
    9 | bool dfs(int a[],vector<int> r,vector<int> l,i){
      |                                              ^
a.cc: In function 'bool dfs(int*, std::vector<int>, std::vector<int>, int)':
a.cc:10:12: error: 'i' was not declared in this scope
   10 |         if(i==MAX_N)return true;
      |            ^
a.cc:11:43: error: 'i' was not declared in this scope
   11 |         if(r.size()==0 || r[r.size()-1]<a[i]){
      |                                           ^
a.cc:13:24: error: 'solve' was not declared in this scope
   13 |                 return solve(a,r,l,i+1);
      |                        ^~~~~
a.cc:15:43: error: 'i' was not declared in this scope
   15 |         if(l.size()==0 || l[l.size()-1]<a[i]){
      |                                           ^
a.cc:17:24: error: 'solve' was not declared in this scope
   17 |                 return solve(a,r,l,i+1);
      |                        ^~~~~
a.cc: In function 'int main()':
a.cc:33:20: error: expected '(' before 'dfs'
   33 |                 if dfs(a,r,l,0){
      |                    ^~~
      |                    (
a.cc:35:18: error: 'else' without a previous 'if'
   35 |                 }else{
      |                  ^~~~
Language: C++

#include <iostream>
#include <stack>
#include <vector>
#include <algorithm>
using namespace std;
static const int MAX_N = 10;
int a[MAX_N] = {0};

bool dfs(int a[],vector<int> r,vector<int> l,int i){
	if(i==MAX_N)return true;
	if(r.size()==0 || r[r.size()-1]<a[i]){
		r.push_back(a[i]);
		return solve(a,r,l,i+1);
	}
	if(l.size()==0 || l[l.size()-1]<a[i]){
		l.push_back(a[i]);
		return solve(a,r,l,i+1);
	}
	return false;
}


int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		for(int j=0;j<10;j++){//input
			cin>>a[j];
		}
		vector<int> r;
		vector<int> l;
		if dfs(a,r,l,0){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
}

Compiler output:
a.cc: In function 'bool dfs(int*, std::vector<int>, std::vector<int>, int)':
a.cc:13:24: error: 'solve' was not declared in this scope
   13 |                 return solve(a,r,l,i+1);
      |                        ^~~~~
a.cc:17:24: error: 'solve' was not declared in this scope
   17 |                 return solve(a,r,l,i+1);
      |                        ^~~~~
a.cc: In function 'int main()':
a.cc:33:20: error: expected '(' before 'dfs'
   33 |                 if dfs(a,r,l,0){
      |                    ^~~
      |                    (
a.cc:35:18: error: 'else' without a previous 'if'
   35 |                 }else{
      |                  ^~~~
Language: C++

#include <iostream>
#include <stack>
#include <vector>
#include <algorithm>
using namespace std;
static const int MAX_N = 10;
int a[MAX_N] = {0};

bool dfs(int a[],vector<int> r,vector<int> l,int i){
	if(i==MAX_N)return true;
	if(r.size()==0 || r[r.size()-1]<a[i]){
		r.push_back(a[i]);
		return dfs(a,r,l,i+1);
	}
	if(l.size()==0 || l[l.size()-1]<a[i]){
		l.push_back(a[i]);
		return dfs(a,r,l,i+1);
	}
	return false;
}


int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		for(int j=0;j<10;j++){//input
			cin>>a[j];
		}
		vector<int> r;
		vector<int> l;
		if dfs(a,r,l,0){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:20: error: expected '(' before 'dfs'
   33 |                 if dfs(a,r,l,0){
      |                    ^~~
      |                    (
a.cc:35:18: error: 'else' without a previous 'if'
   35 |                 }else{
      |                  ^~~~
Language: C++

bool tansaku(vector<int> list,int index,int b,int c)
{
	if (index<10)
	{
		if (b < list[index])
		{
			if (tansaku(list, index + 1, list[index], c))
				return true;
		}
		if (c < list[index])
		{
			if (tansaku(list, index + 1, b, list[index]))
				return true;
		}
	}
	else
	{
		return true;
	}
	return false;
}
int main()
{
	vector<int> s(10);
	int b;

	cin >> b;
	for (int i = 0; i < b; i++)
	{
		for (int j = 0; j < 10; j++)
		{
			cin >> s[j];
		}
		if (tansaku(s, 0, 0, 0))
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc:1:14: error: 'vector' was not declared in this scope
    1 | bool tansaku(vector<int> list,int index,int b,int c)
      |              ^~~~~~
a.cc:1:21: error: expected primary-expression before 'int'
    1 | bool tansaku(vector<int> list,int index,int b,int c)
      |                     ^~~
a.cc:1:31: error: expected primary-expression before 'int'
    1 | bool tansaku(vector<int> list,int index,int b,int c)
      |                               ^~~
a.cc:1:41: error: expected primary-expression before 'int'
    1 | bool tansaku(vector<int> list,int index,int b,int c)
      |                                         ^~~
a.cc:1:47: error: expected primary-expression before 'int'
    1 | bool tansaku(vector<int> list,int index,int b,int c)
      |                                               ^~~
a.cc:1:52: error: expression list treated as compound expression in initializer [-fpermissive]
    1 | bool tansaku(vector<int> list,int index,int b,int c)
      |                                                    ^
a.cc: In function 'int main()':
a.cc:24:9: error: 'vector' was not declared in this scope
   24 |         vector<int> s(10);
      |         ^~~~~~
a.cc:24:16: error: expected primary-expression before 'int'
   24 |         vector<int> s(10);
      |                ^~~
a.cc:27:9: error: 'cin' was not declared in this scope
   27 |         cin >> b;
      |         ^~~
a.cc:32:32: error: 's' was not declared in this scope
   32 |                         cin >> s[j];
      |                                ^
a.cc:34:29: error: 's' was not declared in this scope
   34 |                 if (tansaku(s, 0, 0, 0))
      |                             ^
a.cc:34:28: error: 'tansaku' cannot be used as a function
   34 |                 if (tansaku(s, 0, 0, 0))
      |                     ~~~~~~~^~~~~~~~~~~~
a.cc:36:25: error: 'cout' was not declared in this scope
   36 |                         cout << "YES" << endl;
      |                         ^~~~
a.cc:36:42: error: 'endl' was not declared in this scope
   36 |                         cout << "YES" << endl;
      |                                          ^~~~
a.cc:40:25: error: 'cout' was not declared in this scope
   40 |                         cout << "NO" << endl;
      |                         ^~~~
a.cc:40:41: error: 'endl' was not declared in this scope
   40 |                         cout << "NO" << endl;
      |                                         ^~~~
Language: C++

#include<algorithm>
#include<vector>
#include<queue>

using namespace std;

int A[13] = { 0 };

bool solve(int a, int b,int c) {
	if (++c == 10)
		return true;
	else {
		bool r = false;
		if (a < A[c])
			r = solve(A[c], b, c);
		if (b < A[c] && r == false)
			r = solve(a,A[c], c);
		
		return r;
	}
}

int main(void) {
	A[10] = A[11] = A[12] = 100;
	int n = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 10; j++)
			scanf("%d", &A[j]);
		if (solve(A[0], 0, 0))
			printf("YES\n");
		else
			printf("NO\n");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'scanf' was not declared in this scope
   26 |         scanf("%d", &n);
      |         ^~~~~
a.cc:31:25: error: 'printf' was not declared in this scope
   31 |                         printf("YES\n");
      |                         ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include<queue>
  +++ |+#include <cstdio>
    4 | 
a.cc:33:25: error: 'printf' was not declared in this scope
   33 |                         printf("NO\n");
      |                         ^~~~~~
a.cc:33:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

 
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
  
 int main()
 {
   int N;
   cin>>N
   while(N--)
   {
     int arr[10];
     bool flag=true;
     for(int i=0;i<10;i++) cin>>arr[i];
     for(int i=0;i<8;i++)
     {
       if(arr[i]>arr[i+1]&&arr[i+1]>arr[i+2])
       {
         flag=false;
         break;                                      
       }        
     }     
     if(flag) cout<<"YES"<<endl;
     else cout<<"NO"<<endl;
   }
   //while(1);     
   return 0;  
 }
 

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: expected ';' before 'while'
   22 |    cin>>N
      |          ^
      |          ;
   23 |    while(N--)
      |    ~~~~~
Language: C++

#include <stdio.h>

int ball[10];

bool can(int n,int left,int right){
	bool flag;
	
	if(n==10) return true;
	if(ball[n]>right && can(n+1,left ,ball[n]))return true;
	if(ball[n]>left  && can(n+1,ball[n]),right)return true;
	
	return false;
}


int main(){
	
	int N;
	
	scanf("%d",&N);
	
	for(i=0;i<N;i++){
		for(j=0;j<10;j++){
			scanf("%d",&ball[j]);
		}
		
		printf(can(0,0,0)?"YES":"NO");
		
		
	
}

Compiler output:
a.cc: In function 'bool can(int, int, int)':
a.cc:10:32: error: too few arguments to function 'bool can(int, int, int)'
   10 |         if(ball[n]>left  && can(n+1,ball[n]),right)return true;
      |                             ~~~^~~~~~~~~~~~~
a.cc:5:6: note: declared here
    5 | bool can(int n,int left,int right){
      |      ^~~
a.cc: In function 'int main()':
a.cc:22:13: error: 'i' was not declared in this scope
   22 |         for(i=0;i<N;i++){
      |             ^
a.cc:23:21: error: 'j' was not declared in this scope
   23 |                 for(j=0;j<10;j++){
      |                     ^
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:16:11: note: to match this '{'
   16 | int main(){
      |           ^
Language: C++

#include <stdio.h>

int ball[10];

bool can(int n,int left,int right){
	bool flag;
	
	if(n==10) return true;
	if(ball[n]>right && can(n+1,left ,ball[n])return true;
	if(ball[n]>left  && can(n+1,ball[n],right)return true;
	
	return false;
}


int main(){
	
	int N;
	
	scanf("%d",&N);
	
	for(int i=0;i<N;i++){
		for(int j=0;j<10;j++){
			scanf("%d",&ball[j]);
		}
		
		printf(can(0,0,0)?"YES":"NO");
		
		
	}
}

Compiler output:
a.cc: In function 'bool can(int, int, int)':
a.cc:9:51: error: expected ';' before 'return'
    9 |         if(ball[n]>right && can(n+1,left ,ball[n])return true;
      |                                                   ^~~~~~
      |                                                   ;
a.cc:10:9: error: expected primary-expression before 'if'
   10 |         if(ball[n]>left  && can(n+1,ball[n],right)return true;
      |         ^~
a.cc:9:63: error: expected ')' before 'if'
    9 |         if(ball[n]>right && can(n+1,left ,ball[n])return true;
      |           ~                                                   ^
      |                                                               )
   10 |         if(ball[n]>left  && can(n+1,ball[n],right)return true;
      |         ~~
Language: C++

#include <iostream>
using namespace std;

int Balls[10];

bool fork(int balls[], int i, int b, int c) {
    if (i == 10) return true;
    if (b > balls[i] && c > balls[i]) return false;
    if (b < balls[i]) fork(balls, i + 1, balls[i], c);
    if (c < balls[i]) fork(balls, i + 1, b, balls[i]);
}


int main() {
    int n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 10; j++) {
            cin >> Balls[j];
        if(fork(Balls, 0, 0, 0)) {cout << "YES" << endl;}
        else(){cout << "NO" << endl;}
        }

    }
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: expected primary-expression before ')' token
   20 |         else(){cout << "NO" << endl;}
      |              ^
a.cc: In function 'bool fork(int*, int, int, int)':
a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type]
   11 | }
      | ^
Language: C++

#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
        int n;
        int b = 0;
        int c = 0;
        int d = 0;
        int A[10] = {};
        int B[10] = {};
        int C[10] = {};
        cin >> n;
        for (int i = 0;i < n;i++) {
                for (int j = 0;j < 10;j++) {
                        cin >> A[j];
                }

                for (int j = 0;j < 10;j++) {
                        if (d == 0) {
                                if (j == 0) {
                                        B[0] = A[0];
                                        b++;
                                }
                                if ((A[j] > B[b]) && (B[b] > C[c])) {
                                        B[b] = A[j];
                                        b++;
                                }
                                if (A[j] > C[c]) {
                                        C[c] = A[j];
                                        c++;
                                }
                                if ((A[j] < B[b - 1]) && (A[j] < C[c - 1])) {
                                        cout << "NO" << endl;
                                        d = 1;
                                }
                        }
                }
                if (d == 0) {
                        cout << "YES" << endl;
                }
                d = 0;
        }
        return 0;
}


 

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>

int a[10];

int main() {
	int T;
	cin >> T;
	while (T--) {
		bool ans = true;
		for (int i = 0; i < 10; ++i) {
			cin >> a[i];
		}
		int l, r;
		l = r = 0;
		for (int i = 0; i < 10; ++i) {
			if (a[i] > l) {
				l = a[i];
			} else if (a[i] > r) {
				r = a[i];
			} else {
				and = false;
				break;
			}
		}
		cout << (ans ? "YES" : "NO") << endl;
	}
}

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 >> T;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:21:37: error: expected identifier before '=' token
   21 |                                 and = false;
      |                                     ^
a.cc:25:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |                 cout << (ans ? "YES" : "NO") << 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:25:49: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   25 |                 cout << (ans ? "YES" : "NO") << 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)
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int a[10];

int main() {
	int T;
	cin >> T;
	while (T--) {
		bool ans = true;
		for (int i = 0; i < 10; ++i) {
			cin >> a[i];
		}
		int l, r;
		l = r = 0;
		for (int i = 0; i < 10; ++i) {
			if (a[i] > l) {
				l = a[i];
			} else if (a[i] > r) {
				r = a[i];
			} else {
				and = false;
				break;
			}
		}
		cout << (ans ? "YES" : "NO") << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:37: error: expected identifier before '=' token
   22 |                                 and = false;
      |                                     ^
Language: C++

#include <stdio.h>
int main(void)
{
	int a,b,c[10]={0},d,e,f,g,h,i;
	int e=1;
	scanf("%d",&a);
	for (b=0;b<a;b++)
	{
		e=1;
		for (i=0;i<10;i++)
		{
			scanf("%d",&f);
			c[i]=f;
		}
		if (e==1)
		{
			for (g=1;g<8;g++)
			{
				if (c[g-1]<c[g]||c[g-1]<c[g+1])
				{
					e=0;
				}
				else 
				{
					e=1;
				}
			}
		}
		if (e==0)
		{
			printf("Yes\n");
		}
		if (e==1)
		{
			printf("NO\n");
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: redeclaration of 'int e'
    5 |         int e=1;
      |             ^
a.cc:4:29: note: 'int e' previously declared here
    4 |         int a,b,c[10]={0},d,e,f,g,h,i;
      |                             ^
Language: C++

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

int inp[10];
int n;

bool dfs(int b, int c, int depth) {
  if (depth >= 10) return true;
  if (inp[depth] < b && inp[depth] < c) return false;
  if (inp[depth] > b) dfs(inp[depth], c, depth+1);
  if (inp[depth] > c) dfs(inp[depth], c, depth+1);
}

int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    canbe = false;
    for (int j = 0; j < 10; j++) cin >> inp[j];
    cout << (dfs(0,0,0) ? "YES": "NO") << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'canbe' was not declared in this scope
   17 |     canbe = false;
      |     ^~~~~
a.cc: In function 'bool dfs(int, int, int)':
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^
Language: C++

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    input.readLine();
    while (input.ready())
    {
      String[] INPUT_STR = input.readLine().split(" ");

      System.out.println(solver(INPUT_STR));
    }

  }

  private static String solver(String[] array)
  {
    int currentA = 0;
    int currentB = 0;
    int currentC = 0;

    for (int i = 0; i < array.length; i++)
    {
      currentA = Integer.parseInt(array[i]);
      if (i % 2 == 0)
      {
        if (currentB > currentA)
        {
          return "NO";
        }
        currentB = currentA;
      }
      else
      {
        if (currentC > currentA)
        {
          return "NO";
        }
        currentC = currentA;
      }
    }
    return "YES";
  }

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.IOException;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main
      | ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>

using namespace std;


int q;
int Ball[10];
bool flag;
vector<string> log;

bool is_satisfies(vector<int> a) {
    vector<int> copy = a;
    sort(a.begin(), a.end());
    return a == copy;
}

void bfs(int i, vector<int> B, vector<int> C) {
    if (i == 9) {
        if (is_satisfies(B) && is_satisfies(C))
            flag = true;
        else
            flag = flag == true ? true : false;
    } else {
        vector<int> temp;

        temp = B;
        temp.push_back(Ball[i]);
        bfs(i + 1, temp, C);

        temp = C;
        temp.push_back(Ball[i]);
        bfs(i + 1, B, temp);
    }
}

void solve() {
    vector<int> B, C;
    flag = false;

    bfs(0, B, C);

    if (flag)
        log.push_back("YES");
    else
        log.push_back("NO");
}

int main() {
    cin >> q;
    for (int i = 0; i < q; ++i) {
        for (int j = 0; j < 10; ++j)
            scanf("%d", &Ball[j]);

        solve();
    }

    for (int i = 0; i < log.size(); ++i) {
        cout << log[i] << endl;
    }
}

Compiler output:
a.cc:11:16: warning: built-in function 'log' declared as non-function [-Wbuiltin-declaration-mismatch]
   11 | vector<string> log;
      |                ^~~
a.cc: In function 'bool is_satisfies(std::vector<int>)':
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |     sort(a.begin(), a.end());
      |     ^~~~
      |     short
Language: C++

#include <iostream>
using namespace std;

int main() {
    int n; cin >> n;  // ???????????????????????°
    
    while(n--){
        int balls[10] = {0};
        for(int i = 0; i < 10; i++) cin >> balls[I]; // ??????????????????????????\???
        
        bool isYES = true;  // ???10???????????????????????????????????????
        int topB = 0, topC = 0;  // ???B?????????C???????????¨????????????
        for(int i = 0; i < 10; i++){
            if (topB < balls[i]){
                topB = balls[i];
            } else if (topC < balls[i]) {
                topC = balls[i];
            } else {
                isYES = false;
                break;
            }
        }
        cout << (isYES ? "YES" : "NO") << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:50: error: 'I' was not declared in this scope
    9 |         for(int i = 0; i < 10; i++) cin >> balls[I]; // ??????????????????????????\???
      |                                                  ^
Language: C++

//
//  0033.cpp
//  
//
//  Created by Yoshida Satoshi on 2017/11/16.
//
//

#include <iostream>
using namespace std;

void tsumu(int l,int r,int* in,int j,bool *ans){
    if(j==9){
        *ans=true;
        return;
    }
    if(in[j]>l) tsumu(in[j],r,in,j+1,ans);
    if(in[j]>r) tsumu(l,in[j],in,j+1,ans);
    
    return;
}

int main(){
    int N;
    int in[10];
    int l;
    int r;
    bool ans=false;
    
    cin>>N;
    for(int i=0;i<N;i++){
        l=r=0;
        for(int j=0;j<10;j++){
            cin>>in[j];
        }
        if(tsumu(l,r,in,0,&ans)) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
        
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:17: error: could not convert 'tsumu(l, r, ((int*)(& in)), 0, (& ans))' from 'void' to 'bool'
   36 |         if(tsumu(l,r,in,0,&ans)) cout<<"YES"<<endl;
      |            ~~~~~^~~~~~~~~~~~~~~
      |                 |
      |                 void
Language: C++

#include<cstdio>  
int n,l1,l2,a[15];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
	    bool f=0;l1=-1;l2=0;
		for(int j=1;j<=10;j++)
			scanf("%d",&a[j]);
		for(int j=1;j<=10;j++)
		if(!f)
		{
			if(a[j]<l1&&a[j]<l2){f=1;printf("No\n");break;}
			if(l1>l2){if(a[j]>l1)l1=a[j];else l2=a[j];} 
			else{if(a[j]>l2)l2=a[j];else l1=a[j];}
		}
		if(!f)printf("YES\n");a
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:40: error: expected ';' before '}' token
   18 |                 if(!f)printf("YES\n");a
      |                                        ^
      |                                        ;
   19 |         }
      |         ~
Language: C++

public class Main {
	void run() {
		scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] boll = new int[10];
		for(int k = 0; k < n; k++) {
			for(int i = 0; i < 10; i++) {
				boll[i] = scan.nextInt();
			}
			int judg = 0;
			for(int i = 0; i < n; i++) {
				int right,left;
				right = boll[0];
				left = 0;
				for(int m = 1; m < 10; m++) {
					if(right > boll[m]) {
						if(left < boll[m]) {
							left = boll[m];
						}
						else {
							judg = 0;
							break;
						}
					}
					else if(right < boll[m]) {
						right = boll[m];
					}
					judg = 1;
				}
				if(judg == 0) {
					System.out.println("NO");
				}
				else {
					System.out.println("YES");
				}
			}
		}
	}
	public static void main(String[] args) {
		new Main().run();
	}
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'public'
    1 | public class Main {
      | ^~~~~~
Language: C++

Public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] boll = new int[10];
		for(int k = 0; k < n; k++) {
			for(int i = 0; i < 10; i++) {
				boll[i] = scan.nextInt();
			}
			int judg = 0;
			for(int i = 0; i < n; i++) {
				int right,left;
				right = boll[0];
				left = 0;
				for(int m = 1; m < 10; m++) {
					if(right > boll[m]) {
						if(left < boll[m]) {
							left = boll[m];
						}
						else {
							judg = 0;
							break;
						}
					}
					else if(right < boll[m]) {
						right = boll[m];
					}
					judg = 1;
				}
				if(judg == 0) {
					System.out.println("NO");
				}
				else {
					System.out.println("YES");
				}
			}
		}
	}
	public static void main(String[] args) {
		new Main().run();
	}
}

Compiler output:
a.cc:1:1: error: 'Public' does not name a type
    1 | Public class Main {
      | ^~~~~~
Language: C++

public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] boll = new int[10];
		for(int k = 0; k < n; k++) {
			for(int i = 0; i < 10; i++) {
				boll[i] = scan.nextInt();
			}
			int judg = 0;
			for(int i = 0; i < n; i++) {
				int right,left;
				right = boll[0];
				left = 0;
				for(int m = 1; m < 10; m++) {
					if(right > boll[m]) {
						if(left < boll[m]) {
							left = boll[m];
						}
						else {
							judg = 0;
							break;
						}
					}
					else if(right < boll[m]) {
						right = boll[m];
					}
					judg = 1;
				}
				if(judg == 0) {
					System.out.println("NO");
				}
				else {
					System.out.println("YES");
				}
			}
		}
	}
	public static void main(String[] args) {
		new Main().run();
	}
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'public'
    1 | public class Main {
      | ^~~~~~
Language: C++

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

int n,len,ball[20],used[20];

int f()
{
	int t = -1;
	for (int i=1;i<=10;++i)
		if (!used[i])
		{
			if (ball[i] < t) return 0;
			t = ball[i];
		}
	t = -1;
	for (int i=1;i<=10;++i)
		if (used[i])
		{
			if (ball[i] < t) return 0;
			t = ball[i];	
		}
	return 1;
}

int dfs(int x,int l)
{
	if (l == len) return f();
	for (int i=x+1;i<=10;++i)
		if (!used[i])
		{
			used[i] = 1;
			if (dfs(i,l+1)) return 1;
			used[i] = 0;
		}
	return 0;
}

int main()
{
//	freopen("in.txt","r",stdin);
	cin>>n; 
	while (n--)
	{
		int flag = 0;
		for (int i=1;i<=10;++i) cin>>ball[i];
		for (int i=0;i<=5;++i)
		{
			memset(used,0,sizeof(used));
			len = i;
			if (dfs(0,0)) 
			{
				flag = 1;
				break;
			}
		}
		if (flag) cout<<"YES";
		else cout<<"NO";
		puts("");
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:25: error: 'memset' was not declared in this scope
   49 |                         memset(used,0,sizeof(used));
      |                         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | # include <cstdio>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

int main() {
  int n;
  cin >> n;
  while (n--) {
    int a, b = 0, c = 0;
    bool f = true;
    for (int i = 0; i < 10; ++i) {
      cin >> a;
      if (b < a) b = a;
      else if (c < a) c = a;
      else f = false;
    }
    if (f) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> n;
      |   ^~~
a.cc:13:12: error: 'cout' was not declared in this scope
   13 |     if (f) cout << "YES" << endl;
      |            ^~~~
a.cc:13:29: error: 'endl' was not declared in this scope
   13 |     if (f) cout << "YES" << endl;
      |                             ^~~~
a.cc:14:10: error: 'cout' was not declared in this scope
   14 |     else cout << "NO" << endl;
      |          ^~~~
a.cc:14:26: error: 'endl' was not declared in this scope
   14 |     else cout << "NO" << endl;
      |                          ^~~~
Language: C++

import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main{

	Scanner sc;

	static final int INF=1<<28;
	static final double EPS=1e-9;

	void run(){
		sc=new Scanner(System.in);
		int n=sc.nextInt();
		sc.nextLine();
		for(int k=0; k<n; k++){
			String[] ss=sc.nextLine().split(" ");
			int[] a=new int[10];
			for(int i=0; i<10; i++)
				a[i]=Integer.parseInt(ss[i]);
			int x=0;
			for(int i=0; i<10; i++){
				if(a[i]>x){
					x=a[i];
					a[i]=-1;
				}
			}
			x=0;
			for(int i=0; i<10; i++){
				if(a[i]>x){
					x=a[i];
					a[i]=-1;
				}
			}
			boolean f=true;
			for(int i=0; i<10; i++)
				if(a[i]!=-1){
					f=false;
					break;
				}
			println(f?"YES":"NO");
		}
		sc.close();
	}

	void print(String s){
		System.out.print(s);
	}

	void println(String s){
		System.out.println(s);
	}

	public static void main(String[] args){
		new Main().run();
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.lang.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.math.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.io.*;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import static java.lang.Math.*;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
    7 | import static java.util.Arrays.*;
      | ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: expected unqualified-id before 'public'
    9 | public class Main{
      | ^~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

bool search(int l, int r, int n)
{
  if (n == 10) {
    return true;
  }

  if (l < ball[n]) {
    if (search(ball[n], r, n + 1)) {return true;}
  } 
  if (r < ball[n]) {
    if (search(l, ball[n], n + 1)) {return true;}
  }
  return false;
}

vector<int> ball;
int main()
{
  int N;
  scanf("%d ", &N);
  
  for (int i = 0; i < N; i++) {
    ball.clear();
    ball.resize(10);
    for (int i = 0; i < 10; i++) {
      scanf("%d ", &ball[i]);
    }
    if (search(ball[0], 0, 1)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'bool search(int, int, int)':
a.cc:13:11: error: 'ball' was not declared in this scope
   13 |   if (l < ball[n]) {
      |           ^~~~
a.cc:16:11: error: 'ball' was not declared in this scope
   16 |   if (r < ball[n]) {
      |           ^~~~
Language: C++

#include <cstdio>
#include <stack>
using namespace std;

int main(void)
{
    int n;
    scanf("%d", &n);
    
    for (int i = 0; i < n; i++){
        stack < int > b, c;
        int j;
        
        b.push(0);
        c.push(0);
        
        int ball[10];
        for (int i = 0; i < 10; i++){
            scanf("%d", &ball[i]);
        }
        
        for (j = 0; j < 10; j++){
            if (b.top() < ball[j]){
                if (c.top() < ball[j]){
                    if (c.top() < b.top()){
                        b.push(ball[j]);
                    }
                    else {
                        c.push(ball[j]);
                    }
                }
                else {
                    b.push(ball[j]);
                }
            }
            else if (c.top() < ball[j]){
                c.push(ball[j]);
            }
            else {
                break;
            }
        }
        
//        printf("%d\n", j);
        
        if (j == 10){
            printf("YES\n");
        }
        else {
            printf("NO\n");
    }
    
    return (0);
}

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

a[10];int dfs(int l,int r,int i){if(i>9)return 1;if(a[i]>l&&dfs(a[i],r,i+1))return 1;if(a[i]>r&&dfs(l,a[i],i+1))return 1;return 0;
}main(n){scanf("%d",&n);for(;n;n--)scanf("%d%d%d%d%d%d%d%d%d%d",a+0,a+1,a+2,a+3,a+4,a+5,a+6,a+7,a+8,a+9),dfs(0,0,0)?puts("YES"):puts("NO");return 0;}

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a[10];int dfs(int l,int r,int i){if(i>9)return 1;if(a[i]>l&&dfs(a[i],r,i+1))return 1;if(a[i]>r&&dfs(l,a[i],i+1))return 1;return 0;
      | ^
a.cc: In function 'int dfs(int, int, int)':
a.cc:1:53: error: 'a' was not declared in this scope
    1 | a[10];int dfs(int l,int r,int i){if(i>9)return 1;if(a[i]>l&&dfs(a[i],r,i+1))return 1;if(a[i]>r&&dfs(l,a[i],i+1))return 1;return 0;
      |                                                     ^
a.cc:1:89: error: 'a' was not declared in this scope
    1 | a[10];int dfs(int l,int r,int i){if(i>9)return 1;if(a[i]>l&&dfs(a[i],r,i+1))return 1;if(a[i]>r&&dfs(l,a[i],i+1))return 1;return 0;
      |                                                                                         ^
a.cc: At global scope:
a.cc:2:6: error: expected constructor, destructor, or type conversion before '(' token
    2 | }main(n){scanf("%d",&n);for(;n;n--)scanf("%d%d%d%d%d%d%d%d%d%d",a+0,a+1,a+2,a+3,a+4,a+5,a+6,a+7,a+8,a+9),dfs(0,0,0)?puts("YES"):puts("NO");return 0;}
      |      ^
Language: C++

a[10];
int dfs(int l,int r,int i){
if(i>9)return 1;if(a[i]>l&&dfs(a[i],r,i+1))return 1;
if(a[i]>r&&dfs(l,a[i],i+1))return 1;
return 0;
}
main(n){
scanf("%d",&n);
for(;n;n--)
scanf("%d%d%d%d%d%d%d%d%d%d",a+0,a+1,a+2,a+3,a+4,a+5,a+6,a+7,a+8,a+9),dfs(0,0,0)?puts("YES"):puts("NO");
return 0;
}

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a[10];
      | ^
a.cc: In function 'int dfs(int, int, int)':
a.cc:3:20: error: 'a' was not declared in this scope
    3 | if(i>9)return 1;if(a[i]>l&&dfs(a[i],r,i+1))return 1;
      |                    ^
a.cc:4:4: error: 'a' was not declared in this scope
    4 | if(a[i]>r&&dfs(l,a[i],i+1))return 1;
      |    ^
a.cc: At global scope:
a.cc:7:5: error: expected constructor, destructor, or type conversion before '(' token
    7 | main(n){
      |     ^
Language: C++

a[10];
int dfs(int l,int r,int i){
  if(i>9)return 1;
  if(a[i]>l&&dfs(a[i],r,i+1))return 1;
  if(a[i]>r&&dfs(l,a[i],i+1))return 1;
  return 0;
}
main(n){
  scanf("%d",&n);
  for(;n;n--)
    scanf("%d%d%d%d%d%d%d%d%d%d",a+0,a+1,a+2,a+3,a+4,a+5,a+6,a+7,a+8,a+9),dfs(0,0,0)?puts("YES"):puts("NO");
  return 0;
}

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a[10];
      | ^
a.cc: In function 'int dfs(int, int, int)':
a.cc:4:6: error: 'a' was not declared in this scope
    4 |   if(a[i]>l&&dfs(a[i],r,i+1))return 1;
      |      ^
a.cc:5:6: error: 'a' was not declared in this scope
    5 |   if(a[i]>r&&dfs(l,a[i],i+1))return 1;
      |      ^
a.cc: At global scope:
a.cc:8:5: error: expected constructor, destructor, or type conversion before '(' token
    8 | main(n){
      |     ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int n,ball,tp[2],con,bad;
	
	cin >> n;
	
	for(; n > 0; n--){
		
		tp[0] = tp[1] = 0;
		
		for(int i = 0; i < 10; i++){
			cin >> ball;
			
			if(tp[0] > tp[1]){
				con = 0;
			}else{
				con = 1;
			}
			
			if(ball > tp[con]){
				tp[con] = ball;
			}else if(ball > tp[!con]){
				tp[!con] = ball;
			}else{
				cout << "NO" << endl;
				cin.ignore(64, "\n");
			}
			
			if(i == 9){
				cout << "YES" << endl;
			}
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:48: error: invalid conversion from 'const char*' to 'std::basic_istream<char>::int_type' {aka 'int'} [-fpermissive]
   28 |                                 cin.ignore(64, "\n");
      |                                                ^~~~
      |                                                |
      |                                                const char*
In file included from /usr/include/c++/14/iostream:42,
                 from a.cc:1:
/usr/include/c++/14/istream:544:39: note:   initializing argument 2 of 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::ignore(std::streamsize, int_type) [with _CharT = char; _Traits = std::char_traits<char>; std::streamsize = long int; int_type = int]'
  544 |       ignore(streamsize __n, int_type __delim);
      |                              ~~~~~~~~~^~~~~~~
Language: C++

#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>

typedef long long ll;
using namespace std;

typedef pair<int,int> P;

void seek_lcs(int a,int b,int dp[10+1][10+1],int* num,int* base,vector<int>& idx){
	if(a==0 || b==0){
		return;
	}

	if(num[a] == base[b]){
		seek_lcs(a-1,b-1,dp,num,base,idx);
		idx.push_back(num[a]);
	}
	else{
		if(dp[a-1][b] >= dp[a][b-1]){
			seek_lcs(a-1,b,dp,num,base,idx);
		}
		else{
			seek_lcs(a,b-1,dp,num,base,idx);
		}
	}

}

int main()
{
	int T;
	cin >> T;
	for(int t=0;t<T;t++){

		int num[10+1];
		int base[10+1];
		int dp[10+1][10+1];

		memset(dp,0,sizeof(dp));

		for(int i=1;i<=10;i++){
			scanf("%d",num+i);
			base[i]=i;
		}
		num[0]=0;
		base[0]=0;

		for(int i=0;i<10;i++){
			for(int j=0;j<10;j++){
				if(num[i+1]==base[j+1]){
					dp[i+1][j+1] = max(dp[i+1][j],max(dp[i][j+1],dp[i][j]+1));
				}
				else{
					dp[i+1][j+1] = max(dp[i+1][j],max(dp[i][j+1],dp[i][j]));
				}
			}
		}

		vector<int> idx;
		stack<int> stk;
		seek_lcs(10,10,dp,num,base,idx);

		for(int i=1;i<=10;i++){
			if(find(idx.begin(),idx.end(),num[i]) != idx.end()){
				continue;
			}

			if(stk.empty() || stk.top() < num[i]) stk.push(num[i]);
		}

		printf("%s\n",idx.size() + stk.size() == 10 ? "YES" : "NO");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:17: error: 'memset' was not declared in this scope
   46 |                 memset(dp,0,sizeof(dp));
      |                 ^~~~~~
a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include <map>
  +++ |+#include <cstring>
   10 |
Language: C++

#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>

typedef long long ll;
using namespace std;

typedef pair<int,int> P;

void seek_lcs(int a,int b,int dp[10+1][10+1],int* num,int* base,vector<int>& idx){
	if(a==0 || b==0){
		return;
	}

	if(num[a] == base[b]){
		seek_lcs(a-1,b-1,dp,num,base,idx);
		idx.push_back(num[a]);
	}
	else{
		if(dp[a-1][b] >= dp[a][b-1]){
			seek_lcs(a-1,b,dp,num,base,idx);
		}
		else{
			seek_lcs(a,b-1,dp,num,base,idx);
		}
	}

}

int main()
{
	int T;
	cin >> T;
	for(int t=0;t<T;t++){

		int num[10+1];
		int base[10+1];
		int dp[10+1][10+1];

		memset(dp,0,sizeof(dp));

		for(int i=1;i<=10;i++){
			scanf("%d",num+i);
			base[i]=i;
		}
		num[0]=0;
		base[0]=0;

		for(int i=0;i<10;i++){
			for(int j=0;j<10;j++){
				if(num[i+1]==base[j+1]){
					dp[i+1][j+1] = max(dp[i+1][j],max(dp[i][j+1],dp[i][j]+1));
				}
				else{
					dp[i+1][j+1] = max(dp[i+1][j],max(dp[i][j+1],dp[i][j]));
				}
			}
		}

		vector<int> idx;
		stack<int> stk;
		seek_lcs(10,10,dp,num,base,idx);

		for(int i=1;i<=10;i++){
			if(find(idx.begin(),idx.end(),num[i]) != idx.end()){
				continue;
			}

			if(stk.empty() || stk.top() < num[i]) stk.push(num[i]);
		}

		printf("%s\n",idx.size() + stk.size() == 10 ? "YES" : "NO");
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:17: error: 'memset' was not declared in this scope
   47 |                 memset(dp,0,sizeof(dp));
      |                 ^~~~~~
a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include <map>
  +++ |+#include <cstring>
   10 | #include <string>
Language: C++

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


bool saiki(int ball[],int ttB,int ttC,int res){
	if(res==10)return true;
	if(ball[res]>ttB){
		return saiki(ball,ball[res],ttC,res+1);
	}
	if(ball[res]>ttC){
		return saiki(ball,ttB,ball[res],res+1);
	}
	return false;
}

int main(void){
	int a,b;
	int ball[11];
	int ttB=0,ttC=0;
	int res=0;
	int n;
	scanf("%d",&n);
	for(a=0;a<n;a++){
		memset(ball,0,sizeof(ball));
		ttB=0;
		ttC=0;
		res=0;
		for(b=0;b<10;b++){
			scanf("%d",&ball[b]);
		}
		if(saiki(ball,ttB,ttC,res)==true)printf("Yes\n");else printf("No\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'memset' was not declared in this scope
   27 |                 memset(ball,0,sizeof(ball));
      |                 ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<vector>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
#define MAX_N 10

int N;
int ball[MAX_N];

int used[MAX_N];

bool dfs(int max_l, int max_r, int next) {
    if (next == MAX_N) return true;
    if(ball[next] > max_l)
        return dfs(ball[next],max_r,next+1);
    if(ball[next] > max_r) 
        return dfs(max_l,ball[next],next+1);
    return false;
}

string solve() {
   memset(used,0,sizeof(used));
   return dfs(0,0,0) ? "YES" : "NO";
}

main() {
    cin>>N;
    for(int i=0;i<N;i++) {
        for(int j=0;j<MAX_N;j++) {
            cin>>ball[j];
        }
        cout << solve() << endl;
    }
}

Compiler output:
a.cc: In function 'std::string solve()':
a.cc:20:4: error: 'memset' was not declared in this scope
   20 |    memset(used,0,sizeof(used));
      |    ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc: At global scope:
a.cc:24:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   24 | main() {
      | ^~~~
Language: C++

#include <iostream>
using namespace std;

int Balls[10];

bool dfs(int i, int R, int L)
{
	if(i == 10) return true;

	if(dfs(i+1, Balls[i], L) && Balls[i] > R) return true;

	if(dfs(i+1, R, Balls[i]) && Balls[i] > L) return true;

	return false;
}

void main()
{
	int n;

	cin >> n;
	for(int i=0; i<n; i++){
		for(int j=0; j<10; j++)
			cin >> Balls[j];

		if(dfs(0, 0, 0)) cout << "YES\n";
		else cout << "NO\n";
	}
}

Compiler output:
a.cc:17:1: error: '::main' must return 'int'
   17 | void main()
      | ^~~~
Language: C++

#include <iostream>
using namespace std;

int Balls[10];

bool dfs(int i, int R, int L)
{
	if(i == 10) return true;

	if(dfs(i+1, Balls[i], L) && Balls[i] > R) return true;

	if(dfs(i+1, R, Balls[i]) && Balls[i] > L) return true;

	return false;
}

void main()
{
	int n;

	cin >> n;
	for(int i=0; i<n; i++){
		for(int j=0; j<10; j++)
			cin >> Balls[j];

		if(dfs(0, 0, 0)) cout << "YES\n";
		else cout << "NO\n";
	}

	return 0;
}

Compiler output:
a.cc:17:1: error: '::main' must return 'int'
   17 | void main()
      | ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
int a;
int b;
int n;
int c;
int d;
int e;
int f;
c=0;
while(c<n){
f=0;
a=0;
b=0;
d=0;
while(d<10){
cin >>e;
if(e>a&&a>b){a=e;}
else if(e>b&&b>a){b=e;}
else if(e>a){a=e;}
else if(e>b){b=e;}
else{f=1; break;}
d=d+1;}
if(f==0){cout <<"YES"<<endl;}
if(f==1){cout <<"NO"<<endl;}
c=c+1;}

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

#include<iostream>
#include<vector>

int main(){
    int x;
    std::cin>>x;
    for(int i=0;i<x;++i){
        std::vector<int> vec(10);
        for(int l=0;l<10;++l){
            std::cin>>vec[l];
        }
        std::vector<std::vector<int> > vec2(2);
        vec2[0].push_back(vec[0]);
        for(int l=1;l<vec.size();++l){
            if(l==1){
                if(vec2[0][0]<vec[1]){
                    vec2[0].push_back(vec[1]);
                }else vec2[1].push_back(vec[1]);
            }else{
                if(vec[l]>vec2[0][vec2[0].size()-1]){
                    if(vec2[1].size()!=0&&vec2[1][vec2[1].size()-1]>vec[l]){
                        if(vec2[0][vec2[0].size()-1]>vec2[1][vec2[1].size()-1])vec2[0].push_back(vec[l]);
                        else vec2[1].push_back(vec[l]);
                    }else{
                        vec2[0].push_back
                    }
                }else{
                    if(vec2[1].size()!=0?vec[l]>vec2[1][vec2[1].size()-1]:true){
                        vec2[1].push_back(vec[l]);
                    }else{
                        std::cout<<"NO"<<std::endl;
                        goto cont;
                    }
                }
            }
        }
        std::cout<<"YES"<<std::endl;
    cont:;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:42: error: expected ';' before '}' token
   25 |                         vec2[0].push_back
      |                                          ^
      |                                          ;
   26 |                     }
      |                     ~                     
a.cc:25:33: error: statement cannot resolve address of overloaded function
   25 |                         vec2[0].push_back
Language: C++

#include <iostream>
#include <cstdio>

using namespace std;

int nums[10];

bool check_recursion(int i; int left; int right){
	if(i == 10) return true
	if(nums[i] > left) check_recursion(i+1; nums[i], right);
	if(nums[i] > right) check_recursion(i+1; left, nums[i]);
	
	return false;
}

int main(){
	int n;
	bool ans;
	cin>>n;

	for(;n>0;n--){
		 scanf("%d %d %d %d %d %d %d %d %d %d",&nums[0],&nums[1],&nums[2],&nums[3],&nums[4],&nums[5],&nums[6],&nums[7],&nums[8],&nums[9]);
		 ans = check_recursion(0,0,0);

	}
	return 0;
}

Compiler output:
a.cc:8:27: error: expected ')' before ';' token
    8 | bool check_recursion(int i; int left; int right){
      |                     ~     ^
      |                           )
a.cc:8:48: error: expected initializer before ')' token
    8 | bool check_recursion(int i; int left; int right){
      |                                                ^
a.cc: In function 'int main()':
a.cc:23:39: error: too many arguments to function 'bool check_recursion(int)'
   23 |                  ans = check_recursion(0,0,0);
      |                        ~~~~~~~~~~~~~~~^~~~~~~
a.cc:8:6: note: declared here
    8 | bool check_recursion(int i; int left; int right){
      |      ^~~~~~~~~~~~~~~