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



import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
		// ?????????????????°?????\???
		int gameCount = in.nextInt();
		// ??????????????????????????°????????\???
		int[] cardNum = new int[9];
		// ????????????????????????????????\???
		String[] cardColor = new String[9];
		// ??????????????????????´????????????????
		ArrayList<Integer> resultList = new ArrayList<>();

		for(int setCount = 0; setCount < gameCount; setCount++) {

			for(int cardCount = 0; cardCount < 9; cardCount++) {

				cardNum[cardCount] = in.nextInt();

			}

			for(int cardCount = 0; cardCount < 9; cardCount++) {

				cardColor[cardCount] = in.next();

			}


			Rummy rummy = new Rummy(cardNum, cardColor);

			int[][] hadCard = rummy.hasCardSet(cardNum, cardColor);

			int point = 0;

			point += rummy.sameNumberCheck(hadCard);

			point += rummy.continuousNumberCheck(hadCard);

			if(point == 3) {

				resultList.add(1);

			} else {

				resultList.add(0);

			}
		}

		for(int result: resultList) {

			System.out.println(result);

		}

	}
}

class Rummy{

	// ?????£?????????
	int[] cardNum;
	String[] cardColor;

	

	// ???????????????????????????????????£??????????????´?????????????????????
	int[][] hasCardSet(int[] cardNum, String[] cardColor) {

		int[][] hasCard = new int[3][9];

		for(int i = 0; i < 9; i++) {

			for(int j = 1; j <= 9; j++) {

				if(cardNum[i] == j) {

					switch(cardColor[i]) {

					case "R":

						hasCard[0][j-1] += 1;

						break;

					case "G":

						hasCard[1][j-1] += 1;

						break;

					case "B":

						hasCard[2][j-1] += 1;

						break;

					}
					
					break;
					
				}
			}
		}

		return hasCard;

	}

	int sameNumberCheck(int[][] hasCard) {

		int point = 0;

		hasCardSet(cardNum, cardColor);

		for(int i = 0; i < 3; i++) {

			for(int j = 0; j < 9; j++) {

				if(hasCard[i][j] >= 3) {

					point++;
					hasCard[i][j] -= 3;

				}
			}
		}

		return point;

	}

	int continuousNumberCheck(int[][] hasCard) {

		int point = 0;
		int continuousCount = 0;

		hasCardSet(cardNum, cardColor);

		for(int i = 0; i < 3; i++) {

			for(int j = 0; j < 9; j++) {

				if(hasCard[i][j] != 0) {

					continuousCount++;

					if(continuousCount == 3) {

						point++;
						hasCard[i][j] -= 1;
						hasCard[i][j-1] -= 1;
						hasCard[i][j-2] -= 1;
						j = 0;
						continuousCount = 0;

					}

				} else {

					continuousCount = 0;

				}
			}
		}

		return point;

	}
}

Compiler output:
Main.java:35: error: constructor Rummy in class Rummy cannot be applied to given types;
			Rummy rummy = new Rummy(cardNum, cardColor);
			              ^
  required: no arguments
  found:    int[],String[]
  reason: actual and formal argument lists differ in length
1 error
Language: Java

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int T = scan.nextInt();
		int N[][] = new int[T][9]
		char C[][] = new char[T][9];
		for(int j=0;j<T;j++){
			for(int i=0;i<9;i++){
				N[j][i] = scan.nextInt();
			}
			for(int i=0;i<9;i++){
				C[j*2][i] = scan.nextChar();
			}
		}
		
		Char coler[]={'R','G','B'};

		for(int j=0;j<T;j++){
			int a[] = new int[10];
			int count=0;
			int pea;
			boolean f = false;
			for(int cnum=0;cnum<3;cnum++){
				for(int i=0;i<9;i++){
					if(C[j][i] == coler[cnum]){
						
						a[count]=N[j][i];
						count++;
					}
				}
				if(count>2){
					Arrays.sort(a);
					for(int x=0;a[x+2]==0;x++){
						if((a[x] == a[x+1] && a[x] == a[x+2]) || (a[x] == a[x+1]-1 && a[x] == a[x+2]-2)){
							pea++;
							x+=2;
						}
					}
					if(pea>=3){
						f=true;
					}
				}
			}
			if(f){
				System.out.println("1");
			}else{
				System.out.println("0");
			}
			
		}
	}
}
	


Compiler output:
Main.java:5: error: ';' expected
		int N[][] = new int[T][9]
		                         ^
1 error
Language: Java

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int T = scan.nextInt();
		int N[][] = new int[T][]
		char C[][] = new char[T][];
		for(int j=0;j<T;j++){
			N[j] = new int[9];
			C[j] = new int[9];
			for(int i=0;i<9;i++){
				N[j][i] = scan.nextInt();
			}
			for(int i=0;i<9;i++){
				C[j*2][i] = scan.nextChar();
			}
		}
		
		Char coler[]={'R','G','B'};
		
		

		for(int j=0;j<T;j++){
			int a[] = new int[10];
			int count=0;
			int pea;
			boolean f = false;
			for(int cnum=0;cnum<3;cnum++){
				for(int i=0;i<9;i++){
					if(C[j][i] == coler[cnum]){
						
						a[count]=N[j][i];
						count++;
					}
				}
				if(count>2){
					Arrays.sort(a);
					for(int x=0;a[x+2]==0;x++){
						if((a[x] == a[x+1] && a[x] == a[x+2]) || (a[x] == a[x+1]-1 && a[x] == a[x+2]-2)){
							pea++;
							x+=2;
						}
					}
					if(pea>=3){
						f=true;
					}
				}
			}
			if(f){
				System.out.println("1");
			}else{
				System.out.println("0");
			}
			
		}
	}
}
	


Compiler output:
Main.java:5: error: ';' expected
		int N[][] = new int[T][]
		                        ^
1 error
Language: Java

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int T = scan.nextInt();
		int N[][] = new int[T][];
		char C[][] = new char[T][];
		for(int j=0;j<T;j++){
			N[j] = new int[9];
			C[j] = new int[9];
			for(int i=0;i<9;i++){
				N[j][i] = scan.nextInt();
			}
			for(int i=0;i<9;i++){
				C[j*2][i] = scan.nextChar();
			}
		}
		
		Char coler[]={'R','G','B'};
		
		

		for(int j=0;j<T;j++){
			int a[] = new int[10];
			int count=0;
			int pea;
			boolean f = false;
			for(int cnum=0;cnum<3;cnum++){
				for(int i=0;i<9;i++){
					if(C[j][i] == coler[cnum]){
						
						a[count]=N[j][i];
						count++;
					}
				}
				if(count>2){
					Arrays.sort(a);
					for(int x=0;a[x+2]==0;x++){
						if((a[x] == a[x+1] && a[x] == a[x+2]) || (a[x] == a[x+1]-1 && a[x] == a[x+2]-2)){
							pea++;
							x+=2;
						}
					}
					if(pea>=3){
						f=true;
					}
				}
			}
			if(f){
				System.out.println("1");
			}else{
				System.out.println("0");
			}
			
		}
	}
}
	


Compiler output:
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
Main.java:9: error: incompatible types: int[] cannot be converted to char[]
			C[j] = new int[9];
			       ^
Main.java:18: error: cannot find symbol
		Char coler[]={'R','G','B'};
		^
  symbol:   class Char
  location: class Main
Main.java:36: error: cannot find symbol
					Arrays.sort(a);
					^
  symbol:   variable Arrays
  location: class Main
5 errors
Language: Java

import java.util.Scanner;

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int T = scan.nextInt();
		int N[][] = new int[T][];
		char C[][] = new char[T][];
		for(int j=0;j<T;j++){
			N[j] = new int[9];
			C[j] = new int[9];
			for(int i=0;i<9;i++){
				N[j][i] = scan.nextInt();
			}
			for(int i=0;i<9;i++){
				C[j*2][i] = scan.nextChar();
			}
		}
		
		Char coler[]={'R','G','B'};
		
		

		for(int j=0;j<T;j++){
			int a[] = new int[10];
			int count=0;
			int pea;
			boolean f = false;
			for(int cnum=0;cnum<3;cnum++){
				for(int i=0;i<9;i++){
					if(C[j][i] == coler[cnum]){
						
						a[count]=N[j][i];
						count++;
					}
				}
				if(count>2){
					Arrays.sort(a);
					for(int x=0;a[x+2]==0;x++){
						if((a[x] == a[x+1] && a[x] == a[x+2]) || (a[x] == a[x+1]-1 && a[x] == a[x+2]-2)){
							pea++;
							x+=2;
						}
					}
					if(pea>=3){
						f=true;
					}
				}
			}
			if(f){
				System.out.println("1");
			}else{
				System.out.println("0");
			}
			
		}
	}
}
	


Compiler output:
Main.java:11: error: incompatible types: int[] cannot be converted to char[]
			C[j] = new int[9];
			       ^
Main.java:16: error: cannot find symbol
				C[j*2][i] = scan.nextChar();
				                ^
  symbol:   method nextChar()
  location: variable scan of type Scanner
Main.java:20: error: cannot find symbol
		Char coler[]={'R','G','B'};
		^
  symbol:   class Char
  location: class Main
Main.java:38: error: cannot find symbol
					Arrays.sort(a);
					^
  symbol:   variable Arrays
  location: class Main
4 errors
Language: Java

import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int T = scan.nextInt();
		int N[][] = new int[T][];
		char C[][] = new char[T][];
		for(int j=0;j<T;j++){
			N[j] = new int[9];
			C[j] = new char[9];
			for(int i=0;i<9;i++){
				N[j][i] = scan.nextInt();
			}
			for(int i=0;i<9;i++){
				C[j*2][i] = scan.nextChar();
			}
		}
		
		Char coler[]={'R','G','B'};
		
		

		for(int j=0;j<T;j++){
			int a[] = new int[10];
			int count=0;
			int pea;
			boolean f = false;
			for(int cnum=0;cnum<3;cnum++){
				for(int i=0;i<9;i++){
					if(C[j][i] == coler[cnum]){
						
						a[count]=N[j][i];
						count++;
					}
				}
				if(count>2){
					Arrays.sort(a);
					for(int x=0;a[x+2]==0;x++){
						if((a[x] == a[x+1] && a[x] == a[x+2]) || (a[x] == a[x+1]-1 && a[x] == a[x+2]-2)){
							pea++;
							x+=2;
						}
					}
					if(pea>=3){
						f=true;
					}
				}
			}
			if(f){
				System.out.println("1");
			}else{
				System.out.println("0");
			}
			
		}
	}
}
	


Compiler output:
Main.java:17: error: cannot find symbol
				C[j*2][i] = scan.nextChar();
				                ^
  symbol:   method nextChar()
  location: variable scan of type Scanner
Main.java:21: error: cannot find symbol
		Char coler[]={'R','G','B'};
		^
  symbol:   class Char
  location: class Main
2 errors
Language: Java

import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int T = scan.nextInt();
		int N[][] = new int[T][];
		char C[][] = new char[T][];
		for(int j=0;j<T;j++){
			N[j] = new int[9];
			C[j] = new char[9];
			for(int i=0;i<9;i++){
				N[j][i] = scan.nextInt();
			}
			for(int i=0;i<9;i++){
				C[j*2][i] = scan.next().toCharArray();
			}
		}
		
		char coler[] = {'R','G','B'};

		for(int j=0;j<T;j++){
			int a[] = new int[10];
			int count=0;
			int pea;
			boolean f = false;
			for(int cnum=0;cnum<3;cnum++){
				for(int i=0;i<9;i++){
					if(C[j][i] == coler[cnum]){
						
						a[count]=N[j][i];
						count++;
					}
				}
				if(count>2){
					Arrays.sort(a);
					for(int x=0;a[x+2]==0;x++){
						if((a[x] == a[x+1] && a[x] == a[x+2]) || (a[x] == a[x+1]-1 && a[x] == a[x+2]-2)){
							pea++;
							x+=2;
						}
					}
					if(pea>=3){
						f=true;
					}
				}
			}
			if(f){
				System.out.println("1");
			}else{
				System.out.println("0");
			}
			
		}
	}
}
	


Compiler output:
Main.java:17: error: incompatible types: char[] cannot be converted to char
				C[j*2][i] = scan.next().toCharArray();
				                                   ^
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int T = scan.nextInt();
		int N[][] = new int[T][];
		char C[][] = new char[T][];
		for(int j=0;j<T;j++){
			N[j] = new int[9];
			C[j] = new char[9];
			for(int i=0;i<9;i++){
				N[j][i] = scan.nextInt();
			}
			for(int i=0;i<9;i++){
				String str=scan.next();
				C[j*2][i] = str.toCharArray();
			}
		}
		
		char coler[] = {'R','G','B'};

		for(int j=0;j<T;j++){
			int a[] = new int[10];
			int count=0;
			int pea;
			boolean f = false;
			for(int cnum=0;cnum<3;cnum++){
				for(int i=0;i<9;i++){
					if(C[j][i] == coler[cnum]){
						
						a[count]=N[j][i];
						count++;
					}
				}
				if(count>2){
					Arrays.sort(a);
					for(int x=0;a[x+2]==0;x++){
						if((a[x] == a[x+1] && a[x] == a[x+2]) || (a[x] == a[x+1]-1 && a[x] == a[x+2]-2)){
							pea++;
							x+=2;
						}
					}
					if(pea>=3){
						f=true;
					}
				}
			}
			if(f){
				System.out.println("1");
			}else{
				System.out.println("0");
			}
			
		}
	}
}
	


Compiler output:
Main.java:18: error: incompatible types: char[] cannot be converted to char
				C[j*2][i] = str.toCharArray();
				                           ^
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int T = scan.nextInt();
		int N[][] = new int[T][];
		char C[][] = new char[T][];
		for(int j=0;j<T;j++){
			N[j] = new int[9];
			C[j] = new char[9];
			for(int i=0;i<9;i++){
				N[j][i] = scan.nextInt();
			}
			for(int i=0;i<9;i++){
				String str = scan.next();
				char inpc=str.toCharArray();
				C[j*2][i] = inpc;
			}
		}
		
		char coler[] = {'R','G','B'};

		for(int j=0;j<T;j++){
			int a[] = new int[10];
			int count=0;
			int pea;
			boolean f = false;
			for(int cnum=0;cnum<3;cnum++){
				for(int i=0;i<9;i++){
					if(C[j][i] == coler[cnum]){
						
						a[count]=N[j][i];
						count++;
					}
				}
				if(count>2){
					Arrays.sort(a);
					for(int x=0;a[x+2]==0;x++){
						if((a[x] == a[x+1] && a[x] == a[x+2]) || (a[x] == a[x+1]-1 && a[x] == a[x+2]-2)){
							pea++;
							x+=2;
						}
					}
					if(pea>=3){
						f=true;
					}
				}
			}
			if(f){
				System.out.println("1");
			}else{
				System.out.println("0");
			}
			
		}
	}
}
	


Compiler output:
Main.java:18: error: incompatible types: char[] cannot be converted to char
				char inpc=str.toCharArray();
				                         ^
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int T = scan.nextInt();
		int N[][] = new int[T][];
		char C[][] = new char[T][];
		for(int j=0;j<T;j++){
			N[j] = new int[9];
			C[j] = new char[9];
			for(int i=0;i<9;i++){
				N[j][i] = scan.nextInt();
			}
			for(int i=0;i<9;i++){
				String str = scan.next();
				char[] inpc = str.toCharArray();
				C[j*2][i] = inpc[1];
			}
		}
		
		char coler[] = {'R','G','B'};

		for(int j=0;j<T;j++){
			int a[] = new int[10];
			int count=0;
			int pea;
			boolean f = false;
			for(int cnum=0;cnum<3;cnum++){
				for(int i=0;i<9;i++){
					if(C[j][i] == coler[cnum]){
						
						a[count]=N[j][i];
						count++;
					}
				}
				if(count>2){
					Arrays.sort(a);
					for(int x=0;a[x+2]==0;x++){
						if((a[x] == a[x+1] && a[x] == a[x+2]) || (a[x] == a[x+1]-1 && a[x] == a[x+2]-2)){
							pea++;
							x+=2;
						}
					}
					if(pea>=3){
						f=true;
					}
				}
			}
			if(f){
				System.out.println("1");
			}else{
				System.out.println("0");
			}
			
		}
	}
}
	


Compiler output:
Main.java:42: error: variable pea might not have been initialized
							pea++;
							^
Main.java:46: error: variable pea might not have been initialized
					if(pea>=3){
					   ^
2 errors
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int t = in.nextInt();
		int[] deck = new int[9];
		for (int i = 0; i < t; i++) {
			int isOK = 1;
			for (int j = 0; j < 9; j++) {
				deck[j] = in.nextInt();
			}
			int colorSum = 0;
			for (int j = 0; j < 9; j++) {
				String color = in.next();
				deck[j] += ("R".equals(color)) ? 0x100
						: ("G".equals(color)) ? 0x10000 : 0x1000000;
				colorSum += deck[j];
			}
			colorSum /= 0x100;
			int xFF = 0xFF;
			for (int j = 0; j < 3; j++) {
				if ((colorSum & xFF) % 3 != 0) {
					isOK = 0;
					break;
				}
				xFF <<= 8;
			}
			if (isOK == 1) {
				Arrays.sort(deck);
				int j = 0;
				while (j < 9) {
					if (deck[j] + 2 < deck[j + 2]) {
						isOK = 0;
						break;
					}
					if ((deck[j] == deck[j + 1] && deck[j + 1] == deck[j + 2])
							|| (deck[j] + 1 == deck[j + 1] && deck[j] + 2 == deck[j + 2])) {
						j += 3;
					} else if (j <= 3 && deck[j] + 1 == deck[j + 2]
							&& deck[j] + 2 == deck[j + 4]
							&& deck[j + 1] + 1 == deck[j + 3]
							&& deck[j + 1] + 2 == deck[j + 5]) {
						j += 6;
					} else {
						isOK = 0;
						break;
					}
				}
			}
			System.out.println(isOK);
		}
	}
}

Compiler output:
Main.java:30: error: cannot find symbol
				Arrays.sort(deck);
				^
  symbol:   variable Arrays
  location: class Main
1 error
Language: C++

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

using namespace std;


bool same(int a, int b, int c){
	if(a==b && a==c){
		return true;
	}else{
		return false;
	}
	
}

bool renban(int a, int b, int c){
	if(a+2==c && b+1==c ){
		return true;
	}else{
		return false;
	}
}

int main(){
	int T;
	int n[9];
	vector<int> ans;


	cin >> T;
	for(int i=0; i<T; i++){
		// for (int i = 0; i < 9; ++i)
		// {
		// 	n[i]=0;
		// 	/* code */
		// }
		for(int j=0; j<9; j++){
			cin >> n[j];
			//cout << n[j];
		}
		string color;
		for(int k=0; k<9; k++){
			cin >> color;
			if(color == "R") n[k] += 20
			if(color == "G") n[k] += 40;
			if(color == "B") n[k] += 60;
			//cout << color;
		}
		sort(n,n+9);
		if((same(n[0],n[1],n[2]) || renban(n[0],n[1],n[2]))&& (same(n[3],n[4],n[5]) || renban(n[3],n[4],n[5]))  && (same(n[6],n[7],n[8]) || renban(n[6],n[7],n[8])) ){
			ans.push_back(1);
			//cout << 1 << endl;
		}else{
			ans.push_back(0);
			//cout << 0 << endl;
		}
	}
	for (int i = 0; i < ans.size(); ++i)
	{
		cout << ans[i] <<endl;
		/* code */
	}
		return 0 ;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:52: error: expected ';' before 'if'
   45 |                         if(color == "R") n[k] += 20
      |                                                    ^
      |                                                    ;
   46 |                         if(color == "G") n[k] += 40;
      |                         ~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int T, card[9];

bool is_same_number(int a, int b, int c) {
  return (a==b && b==c) && c==a;
}

bool is_sequence (int a, int b, int c) {
  return (a+2==b+1 && b+1==c) && c==a+2;
}

bool is_good_set(int a, int b, int c) {
  return is_same_number(a, b, c) || is_sequence(a, b, c);
}

bool is_all_good_set() {
  return is_good_set(card[0],card[1],card[2]) &&
    is_good_set(card[3],card[4],card[5]) &&
    is_good_set(card[6],card[7],card[8]);
}

int win() {
  sort(card,card+9);
  do {
    if (is_all_good_set())
      return 1;
  } while (next_permutation (card, card+9));
  return 0;
}
  
int main() {
  cin >> T;
  for (int t=0; t<T; ++t) {
    for (int i=0; i<9; ++i) {
      cin >> card[i];
    }
    string color;
    for (int i=0; i<9; ++i) {
      cin >> color;
      if (color == "G") card[i] +=10;
      else if (color == "B") card[i] += 20;
    }
    cout << win() << endl;
  }
}

Compiler output:
a.cc: In function 'int win()':
a.cc:25:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   25 |   sort(card,card+9);
      |   ^~~~
      |   short
a.cc:29:12: error: 'next_permutation' was not declared in this scope
   29 |   } while (next_permutation (card, card+9));
      |            ^~~~~~~~~~~~~~~~
Language: C++

#include <cstdio>
#include <algorithm>
#include <string>
using namespace std;

int T, card[9];

bool is_set(int a, int b, int c){
  return is_same_number(a, b, c) || is_sequence(a, b, c);
}

bool is_same_number(int a, int b, int c){
  return a == b && b == c;
}

bool is_sequence(int a, int b, int c){
  return a+2 == b+1 && b+1 == c;
}

bool is_all_OK_set(){
  return(is_set(card[0], card[1], card[2])
	 && is_set(card[3], card[4], card[5])
	 && is_set(card[6], card[7], card[8]));
}

int win(){
  sort(card, card+9);
  do{
    if(is_all_OK_set())
      return 1;
  }while(next_permutation(card, card+9));
  return 0;
}

int main(){
  scanf("%d", &T);
  for(int t=0; t<T; ++t){
    for(int i=0; i<9; ++i){
      scanf("%d", &card[i]);
    }
    string color;
    for(int i=0; i<9; ++i){
      scanf("%s", color);
      if(color == "G") card[i] += 10;
      else if(color == "B") card[i] += 20;
    }
    printf("%d", win());
  }
}

Compiler output:
a.cc: In function 'bool is_set(int, int, int)':
a.cc:9:10: error: 'is_same_number' was not declared in this scope
    9 |   return is_same_number(a, b, c) || is_sequence(a, b, c);
      |          ^~~~~~~~~~~~~~
a.cc:9:37: error: 'is_sequence' was not declared in this scope
    9 |   return is_same_number(a, b, c) || is_sequence(a, b, c);
      |                                     ^~~~~~~~~~~
Language: C++

// Rummy
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int T, card[16];
bool is_good_set(int a, int b, int c){
  return is_same_number(a,b,c) || is_sequence(a,b,c);
}
bool is_same_number(int a, int b, int c){
  if (a == b && b == c)
    return true;
  else
    return false;
}
bool is_sequence(int a,int b,int c){
  if (a+2 == c && b+1 == c)
    return true;
  else
    return false;
}
bool is_all_good_set(){
  if is_good_set(card[0],card[1],card[2])
    if is_good_set(card[3],card[4],card[5])
      if is_good_set(card[6],card[7],card[8])
        return true;
  else
    return false;
}
int win(){
  // card ?????????????????? 
  do{
    if // ??????card?????????????????????????????¶????????? 
      return 1;
  } while (next_permutation(card, card+9)); 
  // ??¨???????????????????????????????????????????????¶????????????????????£??? 
  return 0;
}
int main(){
  cin >> T;
  for (int t=0; t<T; ++t) {
    for (int i=0; i<9; ++i) { 
      cin >> card[i];
    }
    string color;
    for (int i=0; i<9; ++i) {
      cin >> color;
        if (color == "G") 
          card[i] += 10;
        else if (color == "B") 
          card[i] += 20;
    }
    cout << win() << endl;
  }
}
// ??????????????¨???
// red:0 , blue:10 , green:20
// 1-9

Compiler output:
a.cc: In function 'bool is_good_set(int, int, int)':
a.cc:8:10: error: 'is_same_number' was not declared in this scope
    8 |   return is_same_number(a,b,c) || is_sequence(a,b,c);
      |          ^~~~~~~~~~~~~~
a.cc:8:35: error: 'is_sequence' was not declared in this scope
    8 |   return is_same_number(a,b,c) || is_sequence(a,b,c);
      |                                   ^~~~~~~~~~~
a.cc: In function 'bool is_all_good_set()':
a.cc:23:6: error: expected '(' before 'is_good_set'
   23 |   if is_good_set(card[0],card[1],card[2])
      |      ^~~~~~~~~~~
      |      (
a.cc:27:3: error: 'else' without a previous 'if'
   27 |   else
      |   ^~~~
a.cc: In function 'int win()':
a.cc:34:7: error: expected '(' before 'return'
   34 |       return 1;
      |       ^~~~~~
      |       (
Language: C++


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

int T, card[16];

int win();

int main() {
  cin >> T;
  for (int t=0; t<T; ++t) {
    for (int i=0; i<9; ++i) {
      cin >> card[i];
	}
    string color;
    for (int i=0; i<9; ++i) {
      cin >> color;
      if (color == "G") card[i] += 10;
      else if (color == "B") card[i] += 20;
	}
    cout << win() << endl;
  }
  return 0;
}

bool is_same_number(int a, int b, int c) {
  if (a == b && b == c) return true;
  else return false;
}

bool is_sequence(int a, int b, int c) {
  if (a+2 == c && b+1 == c) return true;
  else return false;
}

bool is_good_set(int a, int b, int c) {
  return is_same_number(a, b, c) || is_sequence(a, b, c);
}

bool is_all_good_set() {
  return is_good_set(card[0],card[1],card[2]) && is_good_set(card[3],card[4],card[5]) && is_good_set(card[6],card[7],card[8]);
}

int win() {
  sort(card, card+9);
  do {
      if ( is_all_good_set() )
	return 1;
  } while (next_permutation(card, card+9));
  return 0;
}

Compiler output:
a.cc: In function 'int win()':
a.cc:46:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   46 |   sort(card, card+9);
      |   ^~~~
      |   short
a.cc:50:12: error: 'next_permutation' was not declared in this scope
   50 |   } while (next_permutation(card, card+9));
      |            ^~~~~~~~~~~~~~~~
Language: C++

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

int T, card[16];

int win();

int main() {
  cin >> T;
  for (int t=0; t<T; ++t) {
    for (int i=0; i<9; ++i) {
      cin >> card[i];
	}
    string color;
    for (int i=0; i<9; ++i) {
      cin >> color;
      if (color == "G") card[i] += 10;
      else if (color == "B") card[i] += 20;
	}
    cout << win() << endl;
  }
  return 0;
}

bool is_same_number(int a, int b, int c) {
  if (a == b && b == c) return true;
  else return false;
}

bool is_sequence(int a, int b, int c) {
  if (a+2 == c && b+1 == c) return true;
  else return false;
}

bool is_good_set(int a, int b, int c) {
  return is_same_number(a, b, c) || is_sequence(a, b, c);
}

bool is_all_good_set() {
  return is_good_set(card[0],card[1],card[2]) && is_good_set(card[3],card[4],card[5]) && is_good_set(card[6],card[7],card[8]);
}

int win() {
  sort(card, card+9);
  do {
      if ( is_all_good_set() )
	return 1;
  } while (next_permutation(card, card+9));
  return 0;
}

Compiler output:
a.cc: In function 'int win()':
a.cc:45:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   45 |   sort(card, card+9);
      |   ^~~~
      |   short
a.cc:49:12: error: 'next_permutation' was not declared in this scope
   49 |   } while (next_permutation(card, card+9));
      |            ^~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int T, card[16];
int main(){
	cin >> T;
	for (int t = 0; t < T; ++t){
		for (int i = 0; i < 9; i++){
			cin >> card[i];
		}
		string color;
		for (int i = 0; i < 9; i++){
			cin >> color;
			if (color == "G") card[i] += 10;
			else if (color == "B")card[i] += 20;
		}
	}
	cout << win() << endl;
}

bool is_good_set(int a, int b, int c){
	return is_same_number(a, b, c) || is_sequence(a, b, c);
}

bool is_same_number(int a, int b, int c){
	if (a == b&&b == c)return 1;
	else return 0;
}

bool is_sequence(int a, int b, int c){
	if (a == b - 1 && a == c - 2)return 1;
	else return 0;
}

bool is_all_good_set(){
	return is_good_set(card[0], card[1], card[2])
		&& is_good_set(card[3], card[4], card[5])
		&& is_good_set(card[6], card[7], card[8]);
}

int win(){
	sort(card, card + 9);
	do{
		if (is_all_good_set)
			return 1;
	} while (next_permutation(card, card + 9));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'win' was not declared in this scope
   19 |         cout << win() << endl;
      |                 ^~~
a.cc: In function 'bool is_good_set(int, int, int)':
a.cc:23:16: error: 'is_same_number' was not declared in this scope
   23 |         return is_same_number(a, b, c) || is_sequence(a, b, c);
      |                ^~~~~~~~~~~~~~
a.cc:23:43: error: 'is_sequence' was not declared in this scope
   23 |         return is_same_number(a, b, c) || is_sequence(a, b, c);
      |                                           ^~~~~~~~~~~
Language: C++

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

int T, card[16];

bool is_good_set(int a, int b, int c){
	return is_same_number(a, b, c) || is_sequence(a, b, c);
}

bool is_same_number(int a, int b, int c){
	if (a == b && b == c) return true;
	else return false;
}

bool is_sequence(int a, int b, int c){
	if (a == b + 1 && a == c + 2) return true;
	else return false;
}

bool is_all_good_set(int card[9]){
	if (is_good_set(card[0], card[1], card[2]) && is_good_set(card[3], card[4], card[5]) && is_good_set(card[6], card[7], card[8]))
		return true;
	else return false;
}

int main(){
	cin >> T;
	for (int t = 0; t < T; ++t){
		for (int i = 0; i < 9; ++i){
			cin >> card[i];
		}
		string color;
		for (int i = 0; i < 9; ++i){
			cin >> color;
			if (color == "G") card[i] += 10;
			else if (color == "B") card[i] += 20;
		}
		sort(card, card + 9);
		int judge = 0;
		do{
			if (is_all_good_set(card))
				judge = 1;
		} while (next_permutation(card, card + 9));
		cout << judge << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'bool is_good_set(int, int, int)':
a.cc:9:16: error: 'is_same_number' was not declared in this scope
    9 |         return is_same_number(a, b, c) || is_sequence(a, b, c);
      |                ^~~~~~~~~~~~~~
a.cc:9:43: error: 'is_sequence' was not declared in this scope
    9 |         return is_same_number(a, b, c) || is_sequence(a, b, c);
      |                                           ^~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

void show(int* cards);

int main()
{
  int n;
  cin >> n;
  int cards[9];
  for(int i=1; i<=n; i++){
    /* input */
    for(int k=0; k<9; k++){
      cin >> cards[k];
    }
    for(int k=0; k<9; k++){
      char col;
      cin >> col;
      switch (col) {
        case 'R': break;
        case 'G': cards[k] += 10; break;
        case 'B': cards[k] += 20; break;
      }
    }

    /* sort */
    sort(&cards[0], &cards[10]);

    /* judge */
    int judge = 0;
    for(int k=1; k<=3; k++){
      int ind = 3*(k-1);
      if( ((cards[ind] == cards[ind+1])
        && (cards[ind+1] == cards[ind+2])) ||
          (((cards[ind+1] - cards[ind]) == 1)
        && ((cards[ind+2] - cards[ind+1]) == 1)) ){
        judge += 1;
      }
    }

    cout << judge / 3 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   27 |     sort(&cards[0], &cards[10]);
      |     ^~~~
      |     short
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n;
  cin >> n;
  int cards[9];
  for(int i=1; i<=n; i++){
    /* input */
    for(int k=0; k<9; k++){
      cin >> cards[k];
    }
    for(int k=0; k<9; k++){
      char col;
      cin >> col;
      switch (col) {
        case 'R': break;
        case 'G': cards[k] += 10; break;
        case 'B': cards[k] += 20; break;
      }
    }

    /* sort */
    sort(&cards[0], &cards[10]);

    /* judge */
    int judge = 0;
    for(int k=1; k<=3; k++){
      int ind = 3*(k-1);
      if( ((cards[ind] == cards[ind+1])
        && (cards[ind+1] == cards[ind+2])) ||
          (((cards[ind+1] - cards[ind]) == 1)
        && ((cards[ind+2] - cards[ind+1]) == 1)) ){
        judge += 1;
      }
    }

    cout << judge / 3 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   25 |     sort(&cards[0], &cards[10]);
      |     ^~~~
      |     short
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n;
  cin >> n;
  int cards[9];
  for(int i=1; i<=n; i++){
    /* input */
    for(int k=0; k<9; k++){
      cin >> cards[k];
    }
    for(int k=0; k<9; k++){
      char col;
      cin >> col;
      switch (col) {
        case 'R': break;
        case 'G': cards[k] += 10; break;
        case 'B': cards[k] += 20; break;
      }
    }

    /* sort */
    std::sort(&cards[0], &cards[10]);

    /* judge */
    int judge = 0;
    for(int k=1; k<=3; k++){
      int ind = 3*(k-1);
      if( ((cards[ind] == cards[ind+1])
        && (cards[ind+1] == cards[ind+2])) ||
          (((cards[ind+1] - cards[ind]) == 1)
        && ((cards[ind+2] - cards[ind+1]) == 1)) ){
        judge += 1;
      }
    }

    cout << judge / 3 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   25 |     std::sort(&cards[0], &cards[10]);
      |          ^~~~
      |          qsort
Language: C++

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

int T, card[16];

bool is_same_number(int a, int b, int c)
{
    if (a == b and b == c) return true;
    return false;
}

bool is_sequence(int a, int b, int c)
{
    if(a + 1 == b and b + 1 == c) return true;
    return false;
}

bool is_good_set(int a, int b, int c)
{
    return is_same_number(a, b, c) or is_sequence(a, b, c);
}

bool is_all_good_set()
{
    return is_good_set(card[0], card[1], card[2]) and \
        is_good_set(card[3], card[4], card[5]) and \
        is_good_set(card[6], card[7], card[8]);
}

int win()
{
    sort(card, card + 9);
    do {
        if (is_all_good_set()) return 1;
    } while (next_permutation(card, card + 9));
    return 0;
}

int main(int argc, char const* argv[])
{
    cin >> T;
    for (int t = 0; t < T; t++) {
        for (int i = 0; i < 9; i++) {
            cin >> card[i];
        }
        string color;
        for (int i = 0; i < 9; i++) {
            cin >> color;
            if (color == "G") card[i] += 10;
            else if (color == "B") card[i] += 20;
        }
        cout << win() << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int win()':
a.cc:33:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   33 |     sort(card, card + 9);
      |     ^~~~
      |     short
a.cc:36:14: error: 'next_permutation' was not declared in this scope
   36 |     } while (next_permutation(card, card + 9));
      |              ^~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int T,card[16];
int win();
bool is_good_set(int,int,int);
bool is_same_number(int,int,int);
bool is_sequence(int,int,int);
bool is_good_set();
bool is_all_good_set();

int main(){
  cin >> T;
  for(int t=0;t<T;t++){
    for(int i=0;i<9;i++){
      cin >> card[i];
    }
    string color;
    for(int i=0;i<9;i++){
      cin>>color;
      if(color=="G") card[i]+=10;
      else if(color=="B") card[i]+=20;				      
    }
    if(win()){
      cout<<1<<endl;
    }else{
      cout<<0<<endl;
    }
  }
  return 0;
}

bool is_good_set(int a,int b,int c){
  return is_same_number(a,b,c)||is_sequence(a,b,c);
}

bool is_same_number(int a,int b,int c){
  return a==b&&b==c;
}
bool is_sequence(int a,int b,int c){
  return a+2==c&&b+1==c;
}

bool is_all_good_set(){
  return is_good_set(card[0],card[1],card[2])&&is_good_set(card[3],card[4],card[5])&&is_good_set(card[6],card[7],card[8]);
}
int win(){
  sort(card,card+9);
  do{
    if(is_all_good_set()){
      return 1;
    }
  }while(next_permutation(card,card+9));
  return 0;
}

Compiler output:
a.cc: In function 'int win()':
a.cc:48:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   48 |   sort(card,card+9);
      |   ^~~~
      |   short
a.cc:53:10: error: 'next_permutation' was not declared in this scope
   53 |   }while(next_permutation(card,card+9));
      |          ^~~~~~~~~~~~~~~~
Language: C++

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

int T, card[10];


bool is_same_number(int a, int b, int c){
    if(a == b && a == c)    return true;
    else return false;
}//色数字ともに一致

bool is_sequence(int a, int b, int c){
    if(a+2 == c && b+1==c)  return true;
    else return false;
}//色一致で数字連番

bool is_good_set(int a, int b, int c){
    return (is_same_number(a, b, c) || is_sequence(a, b, c));
}//どちらかがtrueならtrueを返す。

bool is_all_good_set(){
    if(is_good_set(card[0],card[1],card[2]) && is_good_set(card[3],card[4],card[5]) && is_good_set(card[6],card[7],card[8]))
    return true;
    else    return false;
}//勝利状態にあるかの確認

int win(){
    sort(card, card+9);
    do{
        if(is_all_good_set())
            return 1;   //cardが勝利状態にある。
    }while(next_permutation(card, card+9));　//next_permutationは全ての組み合わせを昇順に出す関数
    return 0;
}

int main(void){
    cin >> T;
    for(int t=0; t<T; t++){
        for(int i=0; i<9; i++){
            cin >> card[i];
        }
        string color;
        for(int i=0; i<9; i++){
            cin >> color;
            if(color == "G")    card[i] += 10;
            else if(color == "B")   card[i] += 20; //文字と数字それぞれ管理は面倒だから一括にする。
        }
        cout << win() << endl;
    }
    return 0;
}



Compiler output:
a.cc:34:44: error: extended character 　 is not valid in an identifier
   34 |     }while(next_permutation(card, card+9));　//next_permutationは全ての組み合わせを昇順に出す関数
      |                                            ^
a.cc: In function 'int win()':
a.cc:34:44: error: '\U00003000' was not declared in this scope
   34 |     }while(next_permutation(card, card+9));　//next_permutationは全ての組み合わせを昇順に出す関数
      |                                            ^~
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
Language: C++

#include <iostream>
int main(){int n,i,j,p[9],h[32];char c;for(std::cin>>n;n>0;n--){for(i=0;i<30;i++)h[i]=0;for(i=0;i<9;i++)cin>>p[i];for(i=0;i<9;i++){std::cin>>c;if(c==71)p[i]+=10;if(c==66)p[i]+=20;}for(i=0;i<9;i++)h[p[i]]++;for(i=0;i<30;i++)while(h[i]%3)for(j=0;j<3;j++)h[i+j]--;for(i=0;i<30&&h[i]>=0;i++);std::cout<<i-30?0:1<<"\n";}}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:105: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    2 | int main(){int n,i,j,p[9],h[32];char c;for(std::cin>>n;n>0;n--){for(i=0;i<30;i++)h[i]=0;for(i=0;i<9;i++)cin>>p[i];for(i=0;i<9;i++){std::cin>>c;if(c==71)p[i]+=10;if(c==66)p[i]+=20;}for(i=0;i<9;i++)h[p[i]]++;for(i=0;i<30;i++)while(h[i]%3)for(j=0;j<3;j++)h[i+j]--;for(i=0;i<30&&h[i]>=0;i++);std::cout<<i-30?0:1<<"\n";}}
      |                                                                                                         ^~~
      |                                                                                                         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:2:308: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
    2 | int main(){int n,i,j,p[9],h[32];char c;for(std::cin>>n;n>0;n--){for(i=0;i<30;i++)h[i]=0;for(i=0;i<9;i++)cin>>p[i];for(i=0;i<9;i++){std::cin>>c;if(c==71)p[i]+=10;if(c==66)p[i]+=20;}for(i=0;i<9;i++)h[p[i]]++;for(i=0;i<30;i++)while(h[i]%3)for(j=0;j<3;j++)h[i+j]--;for(i=0;i<30&&h[i]>=0;i++);std::cout<<i-30?0:1<<"\n";}}
      |                                                                                                                                                                                                                                                                                                                   ~^~~~~~
      |                                                                                                                                                                                                                                                                                                                   |  |
      |                                                                                                                                                                                                                                                                                                                   |  const char [2]
      |                                                                                                                                                                                                                                                                                                                   int
Language: C++

#include <iostream>
main(){int n,i,j,p[9],h[32];char c;for(std::cin>>n;n>0;n--){for(i=0;i<30;i++)h[i]=0;for(i=0;i<9;i++)std::cin>>p[i];for(i=0;i<9;i++){std::cin>>c;if(c==71)p[i]+=10;if(c==66)p[i]+=20;}for(i=0;i<9;i++)h[p[i]]++;for(i=0;i<30;i++)while(h[i]%3)for(j=0;j<3;j++)h[i+j]--;for(i=0;i<30&&h[i]>=0;i++);std::cout<<i-30?0:1<<"\n";}}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){int n,i,j,p[9],h[32];char c;for(std::cin>>n;n>0;n--){for(i=0;i<30;i++)h[i]=0;for(i=0;i<9;i++)std::cin>>p[i];for(i=0;i<9;i++){std::cin>>c;if(c==71)p[i]+=10;if(c==66)p[i]+=20;}for(i=0;i<9;i++)h[p[i]]++;for(i=0;i<30;i++)while(h[i]%3)for(j=0;j<3;j++)h[i+j]--;for(i=0;i<30&&h[i]>=0;i++);std::cout<<i-30?0:1<<"\n";}}
      | ^~~~
a.cc: In function 'int main()':
a.cc:2:309: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
    2 | main(){int n,i,j,p[9],h[32];char c;for(std::cin>>n;n>0;n--){for(i=0;i<30;i++)h[i]=0;for(i=0;i<9;i++)std::cin>>p[i];for(i=0;i<9;i++){std::cin>>c;if(c==71)p[i]+=10;if(c==66)p[i]+=20;}for(i=0;i<9;i++)h[p[i]]++;for(i=0;i<30;i++)while(h[i]%3)for(j=0;j<3;j++)h[i+j]--;for(i=0;i<30&&h[i]>=0;i++);std::cout<<i-30?0:1<<"\n";}}
      |                                                                                                                                                                                                                                                                                                                    ~^~~~~~
      |                                                                                                                                                                                                                                                                                                                    |  |
      |                                                                                                                                                                                                                                                                                                                    |  const char [2]
      |                                                                                                                                                                                                                                                                                                                    int
Language: C++

#include <iostream>
using namespace std;main(){int n,i,j,p[9];char c;for(cin>>n;n;n--){int h[32]={0};for(i=0;i<9;cin>>p[i++]);for(i=0;i<9;i++){cin>>c;if(c==71)p[i]+=10;if(c==66)p[i]+=20;}for(i=0;i<9;h[p[i++]]++);for(i=0;i<30;i++)while(h[i]%3)for(j=0;j<3;j++)h[i+j]--;for(i=0;i<30&&h[i]>=0;i++);puts(i-30?0:1);}}

Compiler output:
a.cc:2:21: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | using namespace std;main(){int n,i,j,p[9];char c;for(cin>>n;n;n--){int h[32]={0};for(i=0;i<9;cin>>p[i++]);for(i=0;i<9;i++){cin>>c;if(c==71)p[i]+=10;if(c==66)p[i]+=20;}for(i=0;i<9;h[p[i++]]++);for(i=0;i<30;i++)while(h[i]%3)for(j=0;j<3;j++)h[i+j]--;for(i=0;i<30&&h[i]>=0;i++);puts(i-30?0:1);}}
      |                     ^~~~
a.cc: In function 'int main()':
a.cc:2:284: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
    2 | using namespace std;main(){int n,i,j,p[9];char c;for(cin>>n;n;n--){int h[32]={0};for(i=0;i<9;cin>>p[i++]);for(i=0;i<9;i++){cin>>c;if(c==71)p[i]+=10;if(c==66)p[i]+=20;}for(i=0;i<9;h[p[i++]]++);for(i=0;i<30;i++)while(h[i]%3)for(j=0;j<3;j++)h[i+j]--;for(i=0;i<30&&h[i]>=0;i++);puts(i-30?0:1);}}
      |                                                                                                                                                                                                                                                                                        ~~~~^~~~
      |                                                                                                                                                                                                                                                                                            |
      |                                                                                                                                                                                                                                                                                            int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 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/stdio.h:714:30: note:   initializing argument 1 of 'int puts(const char*)'
  714 | extern int puts (const char *__s);
      |                  ~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

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

bool used[9];
int T,n[9],c[3][9],C[3];
char cc;

int main(){
	cin>>T;
	while(T--){
		memset(c,0,sizeof(c));
		fill(C,C+3,0);
		rep(i,9)cin>>n[i];
		rep(i,9){
			cin>>cc;
			if(cc=='R'){c[0][n[i]]++;C[0]++;}
			if(cc=='G'){c[1][n[i]]++;C[1]++;}
			if(cc=='B'){c[2][n[i]]++;C[2]++;}
		}
		int f=1;
		if(C[0]%3+C[1]%3+C[2]%3)f=0;
		rep(i,3){
			if(!C[i])continue;
			int cur=0;
			while(C[i]){
				if(!c[i][cur])cur++;
				else{
					if(c[i][cur]>=3){c[i][cur]-=3;C[i]-=3;}
					else{
						if(!c[i][cur+1]||!c[i][cur+2]){f=0;break;}
						c[i][cur]-=1;c[i][cur+1]-=1;c[i][cur+2]-=1;
						C[i]-=3;
					}
				}
			}
			if(!f)break;
		}
		cout<<(f?1:0)<<endl;
	}
}

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

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

int main(){
  int T;
  deque<int> R,B,G;
  int inx[10];
  char iny;
  map<int,int> Ri,Bi,Gi;



  cin >> T;
  while(T-- > 0){
    R.clear();B.clear();G.clear();
    Ri.clear();Bi.clear();Gi.clear();
    for(int i=0;i<9;i++){
      cin >> inx[i];
    }
    for(int j=0;j<9;j++){
      cin >> iny;
      if(iny == 'R'){
	R.push_back(inx[j]);
	Ri[inx[j]]++;
      }
      else if(iny == 'B'){
	B.push_back(inx[j]);
	Bi[inx[j]]++;
      }
      else if(iny == 'G'){
	G.push_back(inx[j]);
	Gi[inx[j]]++;
      }
    }

    sort(R.begin(),R.end());
    sort(B.begin(),B.end());
    sort(G.begin(),G.end());

    int tp;
    for(int i=0;i<3;i++){
      if(R.size() < 3)break;
      tp = R.front();
      if((Ri[tp+1]>0 && Ri[tp+2]>0)){
	R.pop_front();
	deque<int>::iterator Rit = R.begin();
	while(Rit != R.end()){
	  if(tp+1 == (*Rit)){
	    R.erase(Rit);
	    break;
	  }
	  Rit++;
	}
	Rit = R.begin();
	while(Rit != R.end()){
	  if(tp+2 == (*Rit)){
	    R.erase(Rit);
	    break;
	  }
	  Rit++;
	}
	Ri.clear();
	for(int i=0;i<R.size();i++){
	  Ri[R[i]]++;
	}
      }
      else if(Ri[tp] >= 3){
	R.pop_front();R.pop_front();R.pop_front();
	for(int i=0;i<R.size();i++){
	  Ri[R[i]]++;
	}
      }

    }


 for(int i=0;i<3;i++){
   if(B.size() < 3)breal;
      tp = B.front();
      if((Bi[tp+1]>0 && Bi[tp+2]>0)){
	B.pop_front();
	deque<int>::iterator Bit = B.begin();
	while(Bit != B.end()){
	  if(tp+1 == (*Bit)){
	    B.erase(Bit);
	    break;
	  }
	  Bit++;
	}
	Bit = B.begin();
	while(Bit != B.end()){
	  if(tp+2 == (*Bit)){
	    B.erase(Bit);
	    break;
	  }
	  Bit++;
	}
	Bi.clear();
	for(int i=0;i<B.size();i++){
	  Bi[B[i]]++;
	}
      }
      else if(Bi[tp] >= 3){
	B.pop_front();B.pop_front();B.pop_front();
	for(int i=0;i<B.size();i++){
	  Bi[B[i]]++;
	}
      }
    }

 for(int i=0;i<3;i++){
   if(G.size() < 3)break;
      tp = G.front();
      if((Gi[tp+1]>0 && Gi[tp+2]>0)){
	G.pop_front();
	deque<int>::iterator Git = G.begin();
	while(Git != G.end()){
	  if(tp+1 == (*Git)){
	    G.erase(Git);
	    break;
	  }
	  Git++;
	}
	Git = G.begin();
	while(Git != G.end()){
	  if(tp+2 == (*Git)){
	    G.erase(Git);
	    break;
	  }
	  Git++;
	}
	Gi.clear();
	for(int i=0;i<G.size();i++){
	  Gi[G[i]]++;
	}
      }
      else if(Gi[tp] >= 3){
	G.pop_front();G.pop_front();G.pop_front();
	for(int i=0;i<G.size();i++){
	  Gi[G[i]]++;
	}
      }

    }



 if(R.empty() && G.empty() && B.empty() )cout << "1" << endl;
 else cout << "0" << endl;




  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:82:20: error: 'breal' was not declared in this scope
   82 |    if(B.size() < 3)breal;
      |                    ^~~~~