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

#include <stdio.h>
#define BALLS 10

/* d=0(ツ債カ) =1(ツ右) */

int bin[2][BALLS], p[2];

void push(int d, int n){ bin[d][p[d]++]=n; show(); }
int peek(int d){ if(p[d]==0) return 0; else return bin[d][p[d]-1]; }

int main(void){
	int n, ball, t, i;
	
	scanf("%d",&n);
	
	for(; n>0; n--){
		for(i=0; i<BALLS; i++){
			scanf("%d",&ball);
			
			if(peek(0)>ball && peek(1)>ball) break;
		
			t=(peek(0)>peek(1))?0:1;
			if(peek(t)<ball) push(t,ball); else push(!t,ball);
		}
		if(i==BALLS) printf("YES\n"); else printf("NO\n");
	}
	
	return 0;
}

Compiler output:
main.c: In function 'push':
main.c:8:44: error: implicit declaration of function 'show' [-Wimplicit-function-declaration]
    8 | void push(int d, int n){ bin[d][p[d]++]=n; show(); }
      |                                            ^~~~
Language: C

#include <stdio.h>
#define BALLS 10

/* d=0(ツ債カ) =1(ツ右) */

int main(void){
	int n, ball, top[2]={0,0}, i;
	
	scanf("%d",&n);
	
	for(; n>0; n--){
		for(i=0; i<BALLS; i++){
			scanf("%d",&ball);
			
			if(top[0]>ball && top[1]>ball) break;
		
			t=(top[0]>top[1])?0:1;
			if(top[t]<ball) top[t]=ball; else top[!t]=ball;
		}
		if(i==BALLS) printf("YES\n"); else printf("NO\n");
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:25: error: 't' undeclared (first use in this function)
   17 |                         t=(top[0]>top[1])?0:1;
      |                         ^
main.c:17:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void){
	int n, b[10], top[2]={0,0}, i, t, ok;
	
	scanf("%d",&n);
	
	for(; n>0; n--){
		scanf("%d %d %d %d %d %d %d %d %d %d",&b[0],&b[1],&b[2],&b[3],&b[4],&b[5],&b[6],&b[7],&b[8],&b[9]);
		for(i=0; i<10; i++){			
			if(top[0]>ball[i] && top[1]>ball[i]) break;
			t=(top[0]>top[1])?0:1;
			if(top[t]<ball) top[t]=ball; else top[!t]=ball;
		}
		if(i==10) printf("YES\n"); else printf("NO\n");
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:35: error: 'ball' undeclared (first use in this function)
   11 |                         if(top[0]>ball[i] && top[1]>ball[i]) break;
      |                                   ^~~~
main.c:11:35: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h> int main(void) { int ball[10]; int i,j; int B,C; int n,flag;

scanf("%d",&n); for(i=0;i<n;i++) { flag=1; for(j=0;j<10;j++) { scanf("%d",&ball[j]); } B=C=0; for(j=0;j<10;j++) { if(B<ball[j]) B=ball[j]; else if(C<ball[j]) C=ball[j]; else { flag=0; break; } } if(flag==1) printf("YES\n"); else printf("NO\n");

}

return 0;}

Compiler output:
main.c:1:19: warning: extra tokens at end of #include directive
    1 | #include<stdio.h> int main(void) { int ball[10]; int i,j; int B,C; int n,flag;
      |                   ^~~
main.c:3:7: error: expected declaration specifiers or '...' before string constant
    3 | scanf("%d",&n); for(i=0;i<n;i++) { flag=1; for(j=0;j<10;j++) { scanf("%d",&ball[j]); } B=C=0; for(j=0;j<10;j++) { if(B<ball[j]) B=ball[j]; else if(C<ball[j]) C=ball[j]; else { flag=0; break; } } if(flag==1) printf("YES\n"); else printf("NO\n");
      |       ^~~~
main.c:3:12: error: expected declaration specifiers or '...' before '&' token
    3 | scanf("%d",&n); for(i=0;i<n;i++) { flag=1; for(j=0;j<10;j++) { scanf("%d",&ball[j]); } B=C=0; for(j=0;j<10;j++) { if(B<ball[j]) B=ball[j]; else if(C<ball[j]) C=ball[j]; else { flag=0; break; } } if(flag==1) printf("YES\n"); else printf("NO\n");
      |            ^
main.c:3:17: error: expected identifier or '(' before 'for'
    3 | scanf("%d",&n); for(i=0;i<n;i++) { flag=1; for(j=0;j<10;j++) { scanf("%d",&ball[j]); } B=C=0; for(j=0;j<10;j++) { if(B<ball[j]) B=ball[j]; else if(C<ball[j]) C=ball[j]; else { flag=0; break; } } if(flag==1) printf("YES\n"); else printf("NO\n");
      |                 ^~~
main.c:3:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    3 | scanf("%d",&n); for(i=0;i<n;i++) { flag=1; for(j=0;j<10;j++) { scanf("%d",&ball[j]); } B=C=0; for(j=0;j<10;j++) { if(B<ball[j]) B=ball[j]; else if(C<ball[j]) C=ball[j]; else { flag=0; break; } } if(flag==1) printf("YES\n"); else printf("NO\n");
      |                          ^
main.c:3:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    3 | scanf("%d",&n); for(i=0;i<n;i++) { flag=1; for(j=0;j<10;j++) { scanf("%d",&ball[j]); } B=C=0; for(j=0;j<10;j++) { if(B<ball[j]) B=ball[j]; else if(C<ball[j]) C=ball[j]; else { flag=0; break; } } if(flag==1) printf("YES\n"); else printf("NO\n");
      |                              ^~
main.c:7:1: error: expected identifier or '(' before 'return'
    7 | return 0;}
      | ^~~~~~
main.c:7:10: error: expected identifier or '(' before '}' token
    7 | return 0;}
      |          ^
Language: C

#include<stdio.h>

int main()
{
	int x[10];
	int b,c,d,e,i,n=0;

	scanf("%d",&d);

	while(n<d)
	{
		scanf("%d %d %d %d %d %d %d %d %d %d",x,x+1,x+2,x+3,x+4,x+5,x+6,x+7,x+8,x+9);

		n++;
		b=0;
		c=0;
		e=1;

		for(i=0;i<10;i++)
		{
			if(x[i]>((b<=c)?b:c))
				((b<=c)?b:c)=x[i];
			else
			{
				e=0;
				break;
			}
		}

		if(e)
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:45: error: lvalue required as left operand of assignment
   22 |                                 ((b<=c)?b:c)=x[i];
      |                                             ^
Language: C

#include<stdio.h>

int main()
{
	int x[10],y[10];
	int b,c,d,e,i,n=0,br;

	scanf("%d",&d);

	while(n<d)
	{
		scanf("%d %d %d %d %d %d %d %d %d %d",x,x+1,x+2,x+3,x+4,x+5,x+6,x+7,x+8,x+9);
		br=0;
		for(i=0;i<10;i++)
			y[i]=0;
		for(i=0;i<10;i++)
		{
			if(x[i]<1||x[i]>10)
			{
				br=1;
				break;
			}
			y[x[i]-1]++;
			if(y[x[i]-1]>1)
			{
				br=1;
				break;
			}
		}
		if(br)
			continue;

		n++;
		b=0;
		c=0;
		e=1;

		for(i=0;i<10;i++)
		{
			if(x[i]>((b>=c)?b:c))
				((b>=c)?b:c)=x[i];
			else if(x[i]>((b>c)?c:b))
				((b>c)?c:b)=x[i];
			else
			{
				e=0;
				break;
			}	
		}

		if(e)
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:41:45: error: lvalue required as left operand of assignment
   41 |                                 ((b>=c)?b:c)=x[i];
      |                                             ^
main.c:43:44: error: lvalue required as left operand of assignment
   43 |                                 ((b>c)?c:b)=x[i];
      |                                            ^
Language: C

#include <stdio.h>

int main( void ) {
	int i, n, a[ 10 ], bTop, cTop;

	for ( scanf( "%d", &n ); n--; puts( i != -2 ? "YES" : "NO" ) ) {
		for ( i = 10; i--; scanf( "%d", a + i ) );

		bTop = cTop = 0;
		for ( i = 10; i-- > 0; a[ i ] > bTop ? bTop = a[ i ] : a[ i ] > cTop ? cTop = a[ i ] : i = -1 ) ;
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:106: error: lvalue required as left operand of assignment
   10 |                 for ( i = 10; i-- > 0; a[ i ] > bTop ? bTop = a[ i ] : a[ i ] > cTop ? cTop = a[ i ] : i = -1 ) ;
      |                                                                                                          ^
Language: C

#include<stdio.h>
#include<iostream>
int main(){
	int i,j,a,b,c,d,n,p;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		a=-1;
		b=-1;
		d=0;
		for(j=1;j<=10;j++){
			scanf("%d",&c);
			if(a<b){
				p=a;
				a=b;
				b=p;
			}
			if(c>a)
				a=c;
			else {
				if(c>b)
					b=c;
				else {
					printf("NO\n");
					d=1;
					break;
			    }
			}
		}
		if(d==0) printf("YES\n");
	}	
	return 0;
}

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

#include<stdio.h>
#include<iostream>
int main(){
	int i,j,a,b,c,d,n,p;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		a=-1;
		b=-1;
		d=0;
		for(j=1;j<=10;j++){
			scanf("%d",&c);
			if(a<b){
				p=a;
				a=b;
				b=p;
			}
			if(c>a)
				a=c;
			else {
				if(c>b)
					b=c;
				else {
					printf("NO\n");
					d=1;
					break;
			    }
			}
		}
		if(d==0) printf("YES\n");
	}	
	system("pause");
	return 0;
}

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

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

int balls[20];
int R, L;

bool dfs(int n) {
  if (n == 10) {
    return true;
  }
  if (R < balls[n]) {
    R = balls[n];
    if (dfs(n+1)) {
      return true;
    }
  }
  if (L < balls[n]) {
    L = balls[n];
    if (dfs(n+1)) {
      return true;
    }
  }
  return false;
}

int main(void) {
  int N;
  cin >> N;
  while (N--) {
    for (int i = 0; i < 10; i++) {
      cin >> balls[i];
    }
    R = balls[0];

    if (dfs(1)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << 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 <cstdio>
#include <algorithm>
#include <stack>
using namespace std;

stack<int> B, C;
int A[10];

bool dfs(int index)
{
  bool ret = false;
  char s[11];

  if (index >= 10) {
    return true;
  }

  for (int i = 0; i < 11; i++) {
    if (i < index) s[i] = '>';
    else s[i] = 0;
  }

  if (B.empty() || B.top() < A[index]) {
    B.push(A[index]);
    // printf("%spush %d into B\n", s, A[index]);
    ret = dfs(index + 1);
    // printf("%s%s. pop %d from B\n", s, ret ? "succeeded" : "failed", A[index]);
    B.pop();
  }
  if (!ret && (C.empty() || C.top() < A[index])) {
    C.push(A[index]);
    // printf("%spush %d into C\n", s, A[index]);
    ret = dfs(index + 1);
    // printf("%s%s. pop %d from C\n", s, ret ? "succeeded" : "failed", A[index]);
    C.pop();
  }

  return ret;
}

bool solve()
{
  while (!B.empty()) B.pop();
  while (!C.empty()) C.pop();

  B.push(A[0]);
  bool ret = dfs(1);
  B.pop();

  return ret;
}

int main()
{
  int N;
  scor (int j = 0; j < 10; j++) {
      scanf("%d", A + j);
    }

    if (solve()) {
      printf("Yes\n");
    }
    else {
      printf("No\n");
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:56:9: error: expected primary-expression before 'int'
   56 |   scor (int j = 0; j < 10; j++) {
      |         ^~~
a.cc:56:20: error: 'j' was not declared in this scope
   56 |   scor (int j = 0; j < 10; j++) {
      |                    ^
a.cc: At global scope:
a.cc:68:3: error: expected unqualified-id before 'return'
   68 |   return 0;
      |   ^~~~~~
a.cc:69:1: error: expected declaration before '}' token
   69 | }
      | ^
Language: C++

include<cstdio>
include<iostream>
sing namespace std;
nt main()

   int T;
   scanf("%d",&T);
   while(T--)
   {
       int n1=0,n2=0,x,jd;
       for(int i=1;i<=10;++i)
       {
           scanf("%d",&x);
           if(x>n1){n1=x;continue;}
           if(x>n2){n2=x;continue;}
           jd=1;
       }
       if(jd) puts("NO");
       else   puts("YES");
   }


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<cstdio>
      | ^~~~~~~
a.cc:4:1: error: 'nt' does not name a type; did you mean 'int'?
    4 | nt main()
      | ^~
      | int
a.cc:7:9: error: expected constructor, destructor, or type conversion before '(' token
    7 |    scanf("%d",&T);
      |         ^
a.cc:8:4: error: expected unqualified-id before 'while'
    8 |    while(T--)
      |    ^~~~~
Language: C++

#include<stdio.h>
#include<algorithm>
using namespace std;
int a[10],left[10],right[10];
void dfs(int i,int l,int r)
{
	if(i>9)
	{
		printf("YES\n");
		return;
	}
	else if(a[i]>left[l-1])
	{
		left[l++]=a[i++];
		dfs(i,l,r);
	}
	else if(a[i]>right[r-1])
	{
		right[r++]=a[i++];
		dfs(i,l,r);
	}
	else
	{
		printf("NO\n");
		return;
	}
}
int main()
{
	int t; 
	scanf("%d",&t);
	while(t--)
	{
		memset(a,0,sizeof(a));
		memset(left,0,sizeof(left));
		memset(right,0,sizeof(right));
		for(int i=0;i<10;i++)
			scanf("%d",&a[i]);
		dfs(0,1,1);
	}
	return 0;
}


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

#include<iostream>

using namespace std;

int main(void){
	int a[11],fir,n;
	int i;
	cin>>n;
	while(c--){
		int sec = 0;
		for(i=0;i<10;i++){
			cin>>a[i];
		}
		fir=a[0];
		for(i=1;i<10;i++){
			if(fire<a[i])fir=a[i];
			else if(sec<a[i])sec=a[i];
			else break;
		}
		if(i==10)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'c' was not declared in this scope
    9 |         while(c--){
      |               ^
a.cc:16:28: error: 'fire' was not declared in this scope; did you mean 'fir'?
   16 |                         if(fire<a[i])fir=a[i];
      |                            ^~~~
      |                            fir
Language: C++

int a[10];

bool dfs(int k, int B, int C){
    if(k == 10) return true;
    if(a[k] > B){
        if(dfs(k + 1, a[k], C))
            return true;
    }
    if(a[k] > C){
        if(dfs(k + 1, B, a[k]))
            return true;
    }
    return false;
}

void solve(){
    if(dfs(0, 0, 0))
        printf("YES\n");
    else
        printf("NO\n");
}

int main(int argc, char const *argv[]){

    int t;
    scanf("%d", &t);
    while(t --){
        for(int i = 0; i < 10; i ++)
            scanf("%d", &a[i]);
        solve();
    }

    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:18:9: error: 'printf' was not declared in this scope
   18 |         printf("YES\n");
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int a[10];
a.cc:20:9: error: 'printf' was not declared in this scope
   20 |         printf("NO\n");
      |         ^~~~~~
a.cc:20:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc: In function 'int main(int, const char**)':
a.cc:26:5: error: 'scanf' was not declared in this scope
   26 |     scanf("%d", &t);
      |     ^~~~~
Language: C++

def s(a,i,b,c):
	return  b==sorted(b) and c==sorted(c) if i==10 else s(a,i+1,b+[a[i]],c) or s(a,i+1,b,c+[a[i]])
	
for roop in range(int(raw_input())):
	print "YES" if s(map(int,raw_input().split()),0,[],[]) else "NO"

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def s(a,i,b,c):
      | ^~~
Language: C++

#include <iostream>
using namespace std;

int balls[10];

bool dfs(int i=0,int b_top=0,int c_top=0){
  //10個のボールを落とせたらtrue
  if(i == 10) return true;
  
  //Bのほうに入れる
  if(balls[i] > b_top && dfs(i+1,balls[i],c_top))
    return true;

  //Cの方に入れる
  if(balls[i] > c_top && dfs(i+1,b_top,balls[i]))
    return true;

  return false
}

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

Compiler output:
a.cc: In function 'bool dfs(int, int, int)':
a.cc:18:15: error: expected ';' before '}' token
   18 |   return false
      |               ^
      |               ;
   19 | }
      | ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
    int n; cin >> n;
    while(n--){
        vector<int> v(10);
        rep(i,10) cin >> v[i];
        int a=0, b=0;
        bool is = true;
        for(int i=0; i< 10; i++){
            if(v[i] < a && v[i] < b){is = false; break;}
            if(a < b) (b<v[i]?b:a) = v[i];
            else (a<v[i]?a:b) = v[i];
        }
        cout << (is?"YES":"NO") << endl;
    }
}

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

#include<iostream>
#include<string.h>

using namespace std;

int N;
int balls[10];
void dfs(int n, int a, int b){
if(n==10)return true;
if(balls[n]>a) return dfs(n+1,balls[n],b);
if(balls[n]>b) return dfs(n+1,a,balls[n]);
return false;
}
int main(){
cin>>N;
for(int i=0;i<N;i++){
for(int j=0;j<10;j++){
cin>>balls[j];
}
if(dfs(0,0,balls[0]))cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
}

Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:9:17: error: return-statement with a value, in function returning 'void' [-fpermissive]
    9 | if(n==10)return true;
      |                 ^~~~
a.cc:12:8: error: return-statement with a value, in function returning 'void' [-fpermissive]
   12 | return false;
      |        ^~~~~
a.cc: In function 'int main()':
a.cc:20:7: error: could not convert 'dfs(0, 0, balls[0])' from 'void' to 'bool'
   20 | if(dfs(0,0,balls[0]))cout<<"YES"<<endl;
      |    ~~~^~~~~~~~~~~~~~
      |       |
      |       void
Language: C++

#include<iostream>
using namespace std;

int main()
{
    int balls[10];
    int out[2][10];
    int outCount[2]={0};
    int num;
    cin>>num;
    while(num!=0){
        bool flag=false;
        int a[10]={0};
        for(int i=0;i<10;i++){
            cin>>balls[i];
        }
        for(a[0]=0;a[0]<2;a[0]++){
            for(a[1]=0;a[1]<2;a[1]++){
                for(a[2]=0;a[2]<2;a[2]++){
                    for(a[3]=0;a[3]<2;a[3]++){
                        for(a[4]=0;a[4]<2;a[4]++){
                            for(a[5]=0;a[5]<2;a[5]++){
                                for(a[6]=0;a[6]<2;a[6]++){
                                    for(a[7]=0;a[7]<2;a[7]++){
                                        for(a[8]=0;a[8]<2;a[8]++){
                                            for(a[9]=0;a[9]<2;a[9]++){
                                                for(int i=0;i<10;i++){
                                                    out[a[i]][outCount[a[i]]]=balls[i];
                                                    if(out[a[i]][outCount[a[i]]-1]>balls[i]&&outCount[a[i]]!=0){
                                                        break;
                                                    }
                                                    if(i==9){
                                                        count++;
                                                        flag=true;
                                                    }
                                                    outCount[a[i]]++;
                                                }
                                                for(int i=0;i<10;i++){
                                                    out[0][i]=0;
                                                    out[1][i]=0;
                                                }
                                                outCount[0]=0;
                                                outCount[1]=0;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if(flag){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
        num--;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:57: error: 'count' was not declared in this scope; did you mean 'out'?
   33 |                                                         count++;
      |                                                         ^~~~~
      |                                                         out
Language: C++

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

int main(){
    int n,s;
    cin >> n;
    for (int i=-; i < n; i++){
        int a=0, b=0, flg=0;
        for (int j = 0; j < 10; j++)}{
            cin >> s;
            if (s > a) a=s;
            else (s > b) b=s;
            else flg = 1;
        }
        printf("%s\n", flg==0? "YES": "NO");
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expected primary-expression before ';' token
    8 |     for (int i=-; i < n; i++){
      |                 ^
a.cc:10:37: error: expected primary-expression before '}' token
   10 |         for (int j = 0; j < 10; j++)}{
      |                                     ^
a.cc:12:21: error: 'a' was not declared in this scope
   12 |             if (s > a) a=s;
      |                     ^
a.cc:13:23: error: 'b' was not declared in this scope
   13 |             else (s > b) b=s;
      |                       ^
a.cc:14:13: error: 'else' without a previous 'if'
   14 |             else flg = 1;
      |             ^~~~
a.cc:14:18: error: 'flg' was not declared in this scope
   14 |             else flg = 1;
      |                  ^~~
a.cc:16:24: error: 'flg' was not declared in this scope
   16 |         printf("%s\n", flg==0? "YES": "NO");
      |                        ^~~
a.cc: At global scope:
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

#include<stdio.h>

int main(){

int n[11]={};
int m[11]={},p[11]={};
int N;
bool f=true;

while(1){
scanf("%d",&N);if(N==0)break;

for(int i=0;i<10;i++)
scanf("%d",&n[i]);

for(int i=0;i<10;i++)
if(m[M]<n[i]){M++;m[M]=n[i];}
else if(p[P]<n[i]){P++;p[P]=n[i];}
else f=false;
}

if(f=true)printf("YES\n");
else printf("NO\n");

for(int i=0;i<10;i++)
{p[i]=0;m[i]=0;}

bool f=true;


}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:6: error: 'M' was not declared in this scope
   17 | if(m[M]<n[i]){M++;m[M]=n[i];}
      |      ^
a.cc:18:11: error: 'P' was not declared in this scope
   18 | else if(p[P]<n[i]){P++;p[P]=n[i];}
      |           ^
a.cc:28:6: error: redeclaration of 'bool f'
   28 | bool f=true;
      |      ^
a.cc:8:6: note: 'bool f' previously declared here
    8 | bool f=true;
      |      ^
a.cc: At global scope:
a.cc:32:1: error: expected unqualified-id before 'return'
   32 | return 0;
      | ^~~~~~
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: C++

#include<stdio.h>

int main(){

int n[11]={};
int m[11]={},p[11]={};
int N;
int P=0,M=0;
bool f=true;

while(1){
scanf("%d",&N);if(N==0)break;

for(int i=0;i<10;i++)
scanf("%d",&n[i]);

for(int i=0;i<10;i++)
if(m[M]<n[i]){M++;m[M]=n[i];}
else if(p[P]<n[i]){P++;p[P]=n[i];}
else f=false;
}

if(f=true)printf("YES\n");
else printf("NO\n");

for(int i=0;i<10;i++)
{p[i]=0;m[i]=0;}

bool f=true;
P=0,M=0;


}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:6: error: redeclaration of 'bool f'
   29 | bool f=true;
      |      ^
a.cc:9:6: note: 'bool f' previously declared here
    9 | bool f=true;
      |      ^
a.cc: At global scope:
a.cc:34:1: error: expected unqualified-id before 'return'
   34 | return 0;
      | ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

#include <iostream>

const size = 10;

int num[size];

bool dfs(int beforeB, int beforeC, int depth) {
	if(depth == 10)
		return true;
	
	if(num[depth] > beforeB)
		return dfs(num[depth], beforeC, depth + 1);
	else if(num[depth] > beforeC)
		return dfs(beforeB, num[depth], depth + 1);
	else
		return false;
}

int main() {
	int n = 0;
	std::cin >> n;
	
	for(int i = 0; i < n; ++i) {
		for(auto&& x : num)
			std::cin >> x;
		
		std::cout << dfs(0, 0, 0) ? "YES" : "NO" << std::endl;
	}
}

Compiler output:
a.cc:3:7: error: 'size' does not name a type; did you mean 'size_t'?
    3 | const size = 10;
      |       ^~~~
      |       size_t
a.cc:5:9: error: 'size' was not declared in this scope; did you mean 'std::size'?
    5 | int num[size];
      |         ^~~~
      |         std::size
In file included from /usr/include/c++/14/string:53,
                 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/range_access.h:272:5: note: 'std::size' declared here
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
a.cc: In function 'bool dfs(int, int, int)':
a.cc:11:12: error: 'num' was not declared in this scope; did you mean 'enum'?
   11 |         if(num[depth] > beforeB)
      |            ^~~
      |            enum
a.cc: In function 'int main()':
a.cc:24:32: error: 'num' was not declared in this scope; did you mean 'enum'?
   24 |                 for(auto&& x : num)
      |                                ^~~
      |                                enum
a.cc:27:58: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   27 |                 std::cout << dfs(0, 0, 0) ? "YES" : "NO" << std::endl;
      |                                                     ~~~~~^~~~~~~~~~~~
Language: C++

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

using namespace std;

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


  for(int q=0; q<n;q++) {
    
    vector <int> ball;
    
    ball.resize(10);
    for(int i=0;i<10;i++) cin >> ball[i];
    reverse(ball.begin(),ball.end());
    
    int a[10] = {0},b[11] = {0};
    a[0] = ball.back();
    ball.pop_back();
   int ac = 1;
   int bc = 1;
   int t,flg = 0;
   
   //    cout << "t:a:b" << endl;
   for(int i=0;i<9;i++) {
     
     t = ball.back();
     ball.pop_back();
     // cout << t <<":"<< a[ac-1]<<":" << b[bc-1]<<endl;
     
     if(t > a[ac-1] && a[ac-1] >= b[bc-1]) {
       a[ac] = t;
       ac++;
     }
     else if(t > b[bc-1]) {
       b[bc] = t;
       bc++;
     } else {
       flg = 1;
	break;
     }
    }
   
   if(flg == 0) cout << "YES" <<  endl;
   else cout << "NO" << endl;
   
   ball.clear();
   
  }

  return 0;

}
l.clear();

  }

  return 0;

}

Compiler output:
a.cc:57:1: error: 'l' does not name a type
   57 | l.clear();
      | ^
a.cc:59:3: error: expected declaration before '}' token
   59 |   }
      |   ^
a.cc:61:3: error: expected unqualified-id before 'return'
   61 |   return 0;
      |   ^~~~~~
a.cc:63:1: error: expected declaration before '}' token
   63 | }
      | ^
Language: C++

#include <iostream>
#include <stack>

using namespace std;

bool Solution()
{
    int n;
    
    int left = 0;
    int right = 0;
    
    int a[10];
    
    cin>>n;
    
    where(n--)
    {
        for (int i = 0; i < 10; i++)
        {
            cin>>a[i];
        }
        
        for (int i = 0; i < 10; i++)
        {
            if (a[i] > left) // at the beginning, compare with first ball and the ball before first ball (empty)
            {
                left = a[i];
            }
            else if (a[i] > right)
            {
                right = a[i];
            }
            else                 //when can not enter to the both bottles to the end, then return false
            {
                return false;
            }
        }
    }
}

int main()
{
   if (Solution())
   {
       cout<<"YES"<<endl;
   }
   else
   {
        cout<<"NO"<<endl;
   }
    
    return 0;
}

Compiler output:
a.cc: In function 'bool Solution()':
a.cc:17:5: error: 'where' was not declared in this scope
   17 |     where(n--)
      |     ^~~~~
a.cc:40:1: warning: no return statement in function returning non-void [-Wreturn-type]
   40 | }
      | ^
Language: C++

#include <iostream>
#include <stack>

using namespace std;

bool Solution()
{
    int n;
    
    int left = 0;
    int right = 0;
    
    int a[10];
    
    cin>>n;
    
    where(n--)
    {
        for (int i = 0; i < 10; i++)
        {
            cin>>a[i];
        }
        
        for (int i = 0; i < 10; i++)
        {
            if (a[i] > left) // at the beginning, compare with first ball and the ball before first ball (empty)
            {
                left = a[i];
            }
            else if (a[i] > right)
            {
                right = a[i];
            }
            else                 //when can not enter to the both bottles to the end, then return false
            {
                return false;
            }
        }
        
        return true;
    }
}

int main()
{
   if (Solution())
   {
       cout<<"YES"<<endl;
   }
   else
   {
        cout<<"NO"<<endl;
   }
    
    return 0;
}

Compiler output:
a.cc: In function 'bool Solution()':
a.cc:17:5: error: 'where' was not declared in this scope
   17 |     where(n--)
      |     ^~~~~
a.cc:42:1: warning: no return statement in function returning non-void [-Wreturn-type]
   42 | }
      | ^
Language: C++

#include <iostream>
#include <stack>

using namespace std;

bool Solution()
{
    int n;
    
    int left = 0;
    int right = 0;
    
    int a[10];
    
    cin>>n;
    
    where(n--)
    {
        for (int i = 0; i < 10; i++)
        {
            cin>>a[i];
        }
        
        for (int i = 0; i < 10; i++)
        {
            if (a[i] > left) // at the beginning, compare with first ball and the ball before first ball (empty)
            {
                left = a[i];
            }
            else if (a[i] > right)
            {
                right = a[i];
            }
            else                 //when can not enter to the both bottles to the end, then return false
            {
                return false;
            }
        }
    }
    
    return true;
}

int main()
{
   if (Solution())
   {
       cout<<"YES"<<endl;
   }
   else
   {
        cout<<"NO"<<endl;
   }
    
    return 0;
}

Compiler output:
a.cc: In function 'bool Solution()':
a.cc:17:5: error: 'where' was not declared in this scope
   17 |     where(n--)
      |     ^~~~~
Language: C++

#include <iostream>
#include <vector>
int ball[10];
int left = 0,right = 0;
bool dfs(int de,int left, int right){//??????????????§???????????????
	if(de == 9)return true;
	if(left < ball[de]){
		left = ball[de];
		return dfs(de + 1);
	}
	if(right < ball[de]){
		right = ball[de];
		return dfs(de + 1);
	}
	return false;
}

int main(){
	int n;
	std::cin >> n;
	while(n--){
		for(int i = 0; i < 10; ++i){
			std::cin >> ball[i];
		}
		left = 0, right = 0;
		if(dfs(0,0,0))std::cout << "YES" << std::endl;
		else std::cout << "NO" << std::endl;
	}
}

Compiler output:
a.cc: In function 'bool dfs(int, int, int)':
a.cc:9:27: error: too few arguments to function 'bool dfs(int, int, int)'
    9 |                 return dfs(de + 1);
      |                        ~~~^~~~~~~~
a.cc:5:6: note: declared here
    5 | bool dfs(int de,int left, int right){//??????????????§???????????????
      |      ^~~
a.cc:13:27: error: too few arguments to function 'bool dfs(int, int, int)'
   13 |                 return dfs(de + 1);
      |                        ~~~^~~~~~~~
a.cc:5:6: note: declared here
    5 | bool dfs(int de,int left, int right){//??????????????§???????????????
      |      ^~~
Language: C++

#include <iostream>
#include <vector>
int ball[10];
int left = 0,right = 0;
bool dfs(int de,int left, int right){//??????????????§???????????????
	if(de == 9)return true;
	if(left < ball[de]){
		left = ball[de];
		return dfs(de + 1.left,right);
	}
	if(right < ball[de]){
		right = ball[de];
		return dfs(de + 1,left,right);
	}
	return false;
}

int main(){
	int n;
	std::cin >> n;
	while(n--){
		for(int i = 0; i < 10; ++i){
			std::cin >> ball[i];
		}
		left = 0, right = 0;
		if(dfs(0,0,0))std::cout << "YES" << std::endl;
		else std::cout << "NO" << std::endl;
	}
}

Compiler output:
a.cc: In function 'bool dfs(int, int, int)':
a.cc:9:33: error: unable to find numeric literal operator 'operator""left'
    9 |                 return dfs(de + 1.left,right);
      |                                 ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int a[10];
int b[10];
int ball[20];
bool ans;
void dfs(int k,int ca,int cb)
{
	if(k==10)
	{
		ans = 1;
		return;
	}
	if(ball[k] > a[ca-1])
	{
		a[ca] = ball[k];
		dfs(k+1,ca+1,cb);
		a[ca] = 0;
	}
	if(ball[k] > b[cb-1])
	{
		b[cb] = ball[k];
		dfs(k+1,ca,cb+1);
		b[cb] = 0;
	}
	return;
}
int main()
{
	int n;
	cin >> n;
	while(n--)
	{
		ans = 0;
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		for(int i = 0;i<10;i++)
		{
			cin >> ball[i];
		}
		dfs(0,1,1);
		if(ans == 1)
		cout << "Yes" << endl;
		else
		cout << "No" << endl;
	}
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,a;
  int b = 11,c = 11;
  cin >> n;
  while(n--){
    for(int i = 0;i < 10;i++){
      cin >> a;
      if(b > a)b = a;
      else if(c > a)c = a;
      else {
	cout << "NO" << endl;
	return;
      }  
    }
    cout << "YES" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   15 |         return;
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,a;
  int b = 11,c = 11;
  cin >> n;
  while(n--){
    for(int i = 0;i < 10;i++){
      cin >> a;
      if(b > a)b = a;
      else if(c > a)c = a;
      else {
	cout << "NO" << endl;
	return;
      }  
    }
    cout << "YES" << endl;
  }
  return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   15 |         return;
      |         ^~~~~~
a.cc:20:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   20 |   return;
      |   ^~~~~~
Language: C++

main(){
	int topB,topC;
	int n,tmp;
	int valid;
	
	for (scanf("%d", &n); n--;){
		topB=topC=0;
		valid=1;
		for (int i=0; i<10; i++){
			scanf("%d", &tmp);
			if (tmp > topB) topB=tmp;
			else if (tmp > topC)topC=tmp;
			else {
				valid=0; break;
			}
		}
		printf("%s\n",valid?"YES":"NO");
	}
	return 0;
}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:14: error: 'scanf' was not declared in this scope
    6 |         for (scanf("%d", &n); n--;){
      |              ^~~~~
a.cc:17:17: error: 'printf' was not declared in this scope
   17 |                 printf("%s\n",valid?"YES":"NO");
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){
Language: C++

#include <stdio.h>
#include <stdbool.h>
??
#define NUM_BALL 10
??
int main(void)
{
????int???????????? n;
????int???????????? num;
????int???????????? left, right;
????bool?? flag = true;
????int???? i, j;
??
????scanf("%d", &n);
????for (i = 0; i < n; i++) {
????????????????left = right = -1;
????????????????for (j = 0; j < NUM_BALL; j++) {
????????????????????????scanf("%d", &num);
????????????????????????if?????????? (num > left) { left?? = num; }
????????????????????????else if (num > right)?????? { right = num; }
????????????????????????else?????? { flag?? = false; break; }
????????????????}
????????????????puts((flag) ? "YES" : "NO");
????????}
??
????????return 0;
}

Compiler output:
a.cc:3:1: error: expected unqualified-id before '?' token
    3 | ??
      | ^
Language: C++

#include <stdio.h>
??
#define NUM_BALL 10
??
int main(void)
{
????int???????????? n;
????int???????????? num;
????int???????????? left, right;
????int?? flag = 1;
????int???? i, j;
??
????scanf("%d", &n);
????for (i = 0; i < n; i++) {
????????????????left = right = -1;
????????????????for (j = 0; j < NUM_BALL; j++) {
????????????????????????scanf("%d", &num);
????????????????????????if?????????? (num > left) { left?? = num; }
????????????????????????else if (num > right)?????? { right = num; }
????????????????????????else?????? { flag?? = 0; break; }
????????????????}
????????????????puts((flag) ? "YES" : "NO");
????????}
??
????????return 0;
}

Compiler output:
a.cc:2:1: error: expected unqualified-id before '?' token
    2 | ??
      | ^
Language: C++

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

using namespace std;

int main() {
	vector<int> left;
	vector<int> right;
	vector<int> all;

	bool flag = true;

	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 10; j++) {
			int temp;
			cin >> temp;
			all.push_back(temp);
		}
	}

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 10; j++) {
			if (left.data != NULL) {
				if (all[10 * i + j] > left[left.size() - 1]) {
					left.push_back(all[10 * i + j]);
				}
				else {
					if (right.data != NULL) {
						if (all[10 * i + j] > right[right.size() - 1])
							right.push_back(all[10 * i + j]);
						else
							flag = false;
					}
					else {
						right.push_back(all[10 * i + j]);
					}
				}
			}
			else {
				left.push_back(all[10 * i + j]);
			}
		}

		if (flag)
			cout << "YES";
		else
			cout << "NO";
		flag = true;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:42: warning: NULL used in arithmetic [-Wpointer-arith]
   26 |                         if (left.data != NULL) {
      |                                          ^~~~
a.cc:26:39: error: invalid operands of types '<unresolved overloaded function type>' and 'long int' to binary 'operator!='
   26 |                         if (left.data != NULL) {
      |                                       ^
a.cc:31:59: warning: NULL used in arithmetic [-Wpointer-arith]
   31 |                                         if (right.data != NULL) {
      |                                                           ^~~~
a.cc:31:56: error: invalid operands of types '<unresolved overloaded function type>' and 'long int' to binary 'operator!='
   31 |                                         if (right.data != NULL) {
      |                                                        ^
Language: C++

#include<cstdio> #include<iostream> #include<stack> using namespace std;   stack<int> B; stack<int> C;   int A[10];   int solve(){     for(int i = 0;i<10;i++){         if(!B.empty()){             if(B.top()<A[i]){                 B.push(A[i]);             }else if(C.top()<A[i] || C.empty()){                 C.push(A[i]);             }else{                 return 0;             }         }else{             B.push(A[i]);             //cout<<B.top()<<endl;         }     }     return 1; }    int init(){     while(!B.empty())         B.pop();     while(!C.empty())         C.pop();     B.push(-1);     C.push(-1);  }    int main(void){     int n;     cin>>n;     for(int j = 0;j<n;j++){     init();     for(int i = 0;i<10;i++){         cin>>A[i];     }     if(solve()){         cout<<"YES"<<endl;     }else{         cout<<"NO"<<endl;     }     }     return 0; } 

Compiler output:
a.cc:1:18: warning: extra tokens at end of #include directive
    1 | #include<cstdio> #include<iostream> #include<stack> using namespace std;   stack<int> B; stack<int> C;   int A[10];   int solve(){     for(int i = 0;i<10;i++){         if(!B.empty()){             if(B.top()<A[i]){                 B.push(A[i]);             }else if(C.top()<A[i] || C.empty()){                 C.push(A[i]);             }else{                 return 0;             }         }else{             B.push(A[i]);             //cout<<B.top()<<endl;         }     }     return 1; }    int init(){     while(!B.empty())         B.pop();     while(!C.empty())         C.pop();     B.push(-1);     C.push(-1);  }    int main(void){     int n;     cin>>n;     for(int j = 0;j<n;j++){     init();     for(int i = 0;i<10;i++){         cin>>A[i];     }     if(solve()){         cout<<"YES"<<endl;     }else{         cout<<"NO"<<endl;     }     }     return 0; }
      |                  ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <vector>  

using namespace std;



void solve(vector<int> left, vector<int> right, vector<int> all, int n) {
	bool flag = true;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 10; j++) {
			if (left.size() > 0) {
				if (all[10 * i + j] > left[left.size() - 1]) {
					left.push_back(all[10 * i + j]);
				}
				else {
					if (right.size() > 0) {
						if (all[10 * i + j] > right[right.size() - 1])
							right.push_back(all[10 * i + j]);
						else
							flag = false;
					}
					else {
						right.push_back(all[10 * i + j]);
					}
				}
			}
			else {
				left.push_back(all[10 * i + j]);
			}
		}	 	
		if (flag)
			printf("YES\n");
		else
			printf("NO\n");
		flag = true;
	}
}

int main() {		
	vector<int> left;
	vector<int> right;
	vector<int> all;


	int n;
	scanf_s("%d", &n);
	if (n <= 0) return -1;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 10; j++) {
			int temp;
			cin >> temp;
			all.push_back(temp);
		}
	}	  

	solve(left, right, all, n);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   47 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>
#include <stack>
#include <tuple>
using namespace std;

int main() {
	int n, balls[10]; cin >> n;
    while(n--){
        for(int i = 0; i < 10; i++){
            cin >> balls[i];
        }
        
        bool sortable = false;
        stack<tuple<int, int, int> > states;
        
        states.push(make_tuple(0,0,0));
        while(!states.empty()){
        	tuple<int, int, int> now = states.top();
        	closed.insert(now);
        	states.pop();
        	
        	int idx = get<0>(now);
        	if(idx < 9){
        		if(get<1>(now) < balls[idx]){
        			if(idx + 1 == 9){
        				sortable = true; break;
        			}
        			states.push(make_tuple(idx+1,balls[idx],get<2>(now)));
        		}
        		if(get<2>(now) < balls[idx]){
        			if(idx + 1 == 9){
        				sortable = true; break;
        			}
        			states.push(make_tuple(idx+1,get<1>(now),balls[idx]));
        		}
        	}        	
        }
         
        if(sortable) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'closed' was not declared in this scope; did you mean 'pclose'?
   19 |                 closed.insert(now);
      |                 ^~~~~~
      |                 pclose
Language: C++

// AojTemplete.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

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

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		bool flag = false;
		int prev;
		int in[10];
		int used[10];
		for (int j = 0; j < 10; j++)
		{
			cin >> in[j];
		}
		prev = in[0];
		vector<int> B;
		vector<int> C;
		for (int j = 0; j < 10; j++)
		{
			if (prev > in[j])
			{
				C.push_back(in[j]);
				used[j] = false;
				continue;
			}
			else
			{
				prev = in[j];
				B.push_back(in[j]);
				used[j] = true;
			}
		}
		prev = C[0];
		for (int j = 0; j < C.size(); j++)
		{
			if (prev > C[j])
			{
				flag = true;
				break;
			}
			else
			{
				prev = C[j];
			}
		}
		if (flag) cout << "NO" << endl;
		else cout << "YES" << endl;
	}
	return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

int a[10];

bool dfs(int i, int l, int r)
{
    if (i == 10) return true;

    if (l < a[i] && dfs(i + 1, a[i], r)) return true;
    if (r < a[i] && dfs(i + 1, r, a[i])) return true;

    return false;
}

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

    while (n--) {
        l = r = 0;
        for (int i = 0; i < 10; ++i) cin >> a[i];
        cout << (dfs(0, 0, 0) ? "YES" : "NO") << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'l' was not declared in this scope
   22 |         l = r = 0;
      |         ^
a.cc:22:13: error: 'r' was not declared in this scope
   22 |         l = r = 0;
      |             ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int n, ball[10];

bool solve(int idx, int l, int r) {

    if(idx == 10) return true;

    bool ret = false;
    if(ball[idx] > l) ret = ret || solve(idx + 1, ball[idx], r);
    if(ball[idx] > r) ret = ret || solve(idx + 1, l, ball[idx]);
    return ret;

}

int main() {

    cin >> n;

    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < 10; ++j) {
            cin >> ball[j];
        }
        cout << solve(0, 0, 0) ? "YES" : "NO" << endl;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:47: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   26 |         cout << solve(0, 0, 0) ? "YES" : "NO" << endl;
      |                                          ~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int n, ball[10];
 
bool solve(int idx, int l, int r) {
 
    if(idx >= 10) return true;
 
    bool ret = false;
    if(ball[idx] > l) ret = ret || solve(idx + 1, ball[idx], r);
    if(ball[idx] > r) ret = ret || solve(idx + 1, l, ball[idx]);
    return ret;
 
}
 
int main() {
 
    cin >> n;
 
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < 10; ++j) {
            cin >> ball[j];
        }
        cout << solve(0, 0, 0) ? "YES" : "NO" << endl;
    }
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:47: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   26 |         cout << solve(0, 0, 0) ? "YES" : "NO" << endl;
      |                                          ~~~~~^~~~~~~
Language: C++

import java.util.Scanner;
public class Main{
	public static void main(String[] args)throws Exception{
		new Main().solve();
	}
	void solve(){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();//the number of test case
		for(int i=0;i<n;i++){
			int[] d=new int[10];
			for(int j=0;j<10;j++){
				d[j]=sc.nextInt();
			}
			int a=-999999;int b=-999999;
			//??????a<=b????????????????????????
			outside:for(int j=0;j<10;j++){
				if(d[j]>b)b=d[j];
				else if(d[j]>a)a=d[j];
				else{
					System.out.println("NO");
					break outside;
				}
				if(a>b){
					int dummy=b;
					b=a;
					a=dummy;
				}
				if(j==9)System.out.println("YES");
			}
		}
	}
}

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

#include<iostream>
using namespace std;
int d[10]={};
bool f;
void dfs(int l,int r int s){
  if(s==10) f=true;
  //cout << d << endl;
  if(l<d[s]){
    dfs(d[s],r,s+1);
  }
  if(r<d[s]){
    dfs(l,d[s],s+1);
  }
}
int main(){
  int n;cin >> n;
  while(n--){
    int r=0,l=0,d;
    f=false;
    for(int i=0;i<10;i++){
      cin >> d;
      //cout << l << ":" << r << endl;
    }
    dfs(0,0,0);
    if(f) cout << "NO" << endl;
    else cout << "YES" << endl;
  }  
}

Compiler output:
a.cc:5:22: error: expected ',' or '...' before 'int'
    5 | void dfs(int l,int r int s){
      |                      ^~~
a.cc: In function 'void dfs(int, int)':
a.cc:6:6: error: 's' was not declared in this scope
    6 |   if(s==10) f=true;
      |      ^
a.cc:8:10: error: 's' was not declared in this scope
    8 |   if(l<d[s]){
      |          ^
a.cc:11:10: error: 's' was not declared in this scope
   11 |   if(r<d[s]){
      |          ^
a.cc: In function 'int main()':
a.cc:24:8: error: too many arguments to function 'void dfs(int, int)'
   24 |     dfs(0,0,0);
      |     ~~~^~~~~~~
a.cc:5:6: note: declared here
    5 | void dfs(int l,int r int s){
      |      ^~~