Language: C++



namespace ConsoleApplication1
{
    class Program
    {
        /// <summary>
        /// ????????°???????????¨?????????????????????
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            int SET_CARDS = 9;

            int count = int.Parse(Console.ReadLine());

            for(int ds = 0; ds < count; ds++)
            {
                // ??????????????????
                var list = new Card[SET_CARDS];

                // ??\???????????????
                string[] nums = Console.ReadLine().Split(' ');
                string[] marks = Console.ReadLine().Split(' ');

                // ??\????????????????????????????????????
                for (int i = 0; i < SET_CARDS; i++)
                    list[i] = new Card() { Mark = marks[i], Num = int.Parse(nums[i]) };
                
                // ?????????????????????
                Array.Sort(list, (c1, c2) => c1.Num - c2.Num);
                Array.Sort(list, (c1, c2) => char.Parse(c1.Mark) - char.Parse(c2.Mark));

                // ???????????????????????????
                Console.WriteLine(Judge(list) ? "1" : "0");
            }
        }

        /// <summary>
        /// ????????????
        /// </summary>
        /// <param name="cards">??????????????????</param>
        /// <returns>??????????????????????????????????????£????????????true???????????\??????false</returns>
        private static bool Judge(Card[] cards)
        {
            // ?????????????????????????????£?????????true
            if (cards.Length == 0)
                return true;

            // ????????????????????????3?????????????????¢??????
            for (int c1 = 0; c1 < cards.Length - 2; c1++)
            {
                for(int c2 = c1 + 1; c2 < cards.Length - 1; c2++)
                {
                    for (int c3 = c2 + 1; c3 < cards.Length; c3++)
                    {
                        // 3???????????????????????????????????§?????????
                        if(cards[c1].Mark == cards[c2].Mark && cards[c1].Mark == cards[c3].Mark)
                        {
                            // 3??????????????????????????°??????????????£?¶?????????°?????§?????????
                            if((cards[c1].Num == cards[c2].Num && cards[c1].Num == cards[c3].Num)
                                || (cards[c1].Num == cards[c2].Num - 1 && cards[c1].Num == cards[c3].Num - 2))
                            {
                                // ???????????¢???????????????????????\?????????????????§??????????????????????????????
                                List<Card> list = new List<Card>();
                                for(int i = 0; i < cards.Length; i++)
                                {
                                    if (i != c1 && i != c2 && i != c3)
                                        list.Add(cards[i]);
                                }

                                // ???????????????????????????????????§?????°??????
                                if (Judge(list.ToArray()))
                                    return true;
                            }
                        }
                    }
                }
            }

            return false;
        }
    }

    /// <summary>
    /// ??????????????????
    /// </summary>
    public class Card
    {
        /// <summary>
        /// ?????????
        /// </summary>
        public string Mark { get; set; }
        /// <summary>
        /// ??°???
        /// </summary>
        public int Num { get; set; }
    }
}

Compiler output:
a.cc:11:26: error: 'string' has not been declared
   11 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:11:35: error: expected ',' or '...' before 'args'
   11 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:44:16: error: expected ':' before 'static'
   44 |         private static bool Judge(Card[] cards)
      |                ^~~~~~~
      |                :
a.cc:44:35: error: 'Card' has not been declared
   44 |         private static bool Judge(Card[] cards)
      |                                   ^~~~
a.cc:44:42: error: expected ',' or '...' before 'cards'
   44 |         private static bool Judge(Card[] cards)
      |                                          ^~~~~
a.cc:83:6: error: expected ';' after class definition
   83 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void ConsoleApplication1::Program::Main(int*)':
a.cc:15:25: error: expected primary-expression before 'int'
   15 |             int count = int.Parse(Console.ReadLine());
      |                         ^~~
a.cc:20:17: error: 'var' was not declared in this scope
   20 |                 var list = new Card[SET_CARDS];
      |                 ^~~
a.cc:23:17: error: 'string' was not declared in this scope
   23 |                 string[] nums = Console.ReadLine().Split(' ');
      |                 ^~~~~~
a.cc:23:24: error: expected primary-expression before ']' token
   23 |                 string[] nums = Console.ReadLine().Split(' ');
      |                        ^
a.cc:24:24: error: expected primary-expression before ']' token
   24 |                 string[] marks = Console.ReadLine().Split(' ');
      |                        ^
a.cc:28:21: error: 'list' was not declared in this scope
   28 |                     list[i] = new Card() { Mark = marks[i], Num = int.Parse(nums[i]) };
      |                     ^~~~
a.cc:28:35: error: expected type-specifier before 'Card'
   28 |                     list[i] = new Card() { Mark = marks[i], Num = int.Parse(nums[i]) };
      |                                   ^~~~
a.cc:31:17: error: 'Array' was not declared in this scope
   31 |                 Array.Sort(list, (c1, c2) => c1.Num - c2.Num);
      |                 ^~~~~
a.cc:31:28: error: 'list' was not declared in this scope
   31 |                 Array.Sort(list, (c1, c2) => c1.Num - c2.Num);
      |                            ^~~~
a.cc:31:35: error: 'c1' was not declared in this scope
   31 |                 Array.Sort(list, (c1, c2) => c1.Num - c2.Num);
      |                                   ^~
a.cc:31:39: error: 'c2' was not declared in this scope
   31 |                 Array.Sort(list, (c1, c2) => c1.Num - c2.Num);
      |                                       ^~
a.cc:31:44: error: expected primary-expression before '>' token
   31 |                 Array.Sort(list, (c1, c2) => c1.Num - c2.Num);
      |                                            ^
a.cc:32:44: error: expected primary-expression before '>' token
   32 |                 Array.Sort(list, (c1, c2) => char.Parse(c1.Mark) - char.Parse(c2.Mark));
      |                                            ^
a.cc:32:46: error: expected primary-expression before 'char'
   32 |                 Array.Sort(list, (c1, c2) => char.Parse(c1.Mark) - char.Parse(c2.Mark));
      |                                              ^~~~
a.cc:35:17: error: 'Console' was not declared in this scope
   35 |                 Console.WriteLine(Judge(list) ? "1" : "0");
      |                 ^~~~~~~
a.cc: In static member function 'static bool ConsoleApplication1::Program::Judge(int*)':
a.cc:47:17: error: 'cards' was not declared in this scope
   47 |             if (cards.Length == 0)
      |                 ^~~~~
a.cc:51:35: error: 'cards' was not declared in this scope
   51 |             for (int c1 = 0; c1 < cards.Length - 2; c1++)
      |                                   ^~~~~
a.cc:65:33: error: 'List' was not declared in this scope
   65 |                                 List<Card> list = new List<Card>();
      |                                 ^~~~
a.cc:65:38: error: 'Card' was not declared in this scope
   65 |                                 List<Card> list = new List<Card>();
      |                                      ^~~~
a.cc:65:44: error: 'list' was not declared in this scope
   65 |                                 List<Card> list = new List<Card>();
      |                                            ^~~~
a.cc:65:55: error: 'List' does not name a type
   65 |                                 List<Card> list = new List<Card>();
      |                                                       ^~~~
a.cc:65:66: error: expected primary-expression before ')' token
   65 |                                 List<Card> list = new List<Card>();
      |                                                                  ^
a.cc: At global scope:
a.cc:88:5: error: expected unqualified-id before 'public'
   88 |     public class Card
      |     ^~~~~~