Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DPG3
{
    class Program
    {
        public static int[,] TBL;
        public static int[] DP;
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int N = int.Parse(input[0]);
            TBL = new int[N + 1, N + 1]; //テーブルを準備する
            DP = new int[N + 1];
            int M = int.Parse(input[1]);
            for (int i = 0; i < M; i++)
            {
                string[] input_xy = Console.ReadLine().Split(' ');
                int x = int.Parse(input_xy[0]);
                int y = int.Parse(input_xy[1]);
                TBL[x, y] = 1;
            }
            for (int i = 1; i <= N; i++)
            {
                for (int j = 1; j <= N; j++)
                {
                    if (TBL[i,j]==1)
                    {
                        check_TBL(i,j,N);
                    }
                }
            }
            /*
            for (int i = 1; i <= N; i++)
            {
                Console.WriteLine(DP[i]);
            }
            */
            Console.WriteLine(DP.Max());
        }
        public static void check_TBL(int i,int j,int N)
        {
            int tmp = 1;
            for (int k = 1; k <=N ; k++)
            {
                 if (TBL[j,k]!=0)
                    {
                        tmp++;
                        check_TBL(j,k, N);
                    }
                if (tmp > DP[i]) DP[i] = tmp;
            }
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:11:15: error: expected ':' before 'static'
   11 |         public static int[,] TBL;
      |               ^~~~~~~
      |               :
a.cc:11:26: error: expected unqualified-id before '[' token
   11 |         public static int[,] TBL;
      |                          ^
a.cc:12:15: error: expected ':' before 'static'
   12 |         public static int[] DP;
      |               ^~~~~~~
      |               :
a.cc:12:26: error: expected unqualified-id before '[' token
   12 |         public static int[] DP;
      |                          ^
a.cc:13:26: error: 'string' has not been declared
   13 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:13:35: error: expected ',' or '...' before 'args'
   13 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:45:15: error: expected ':' before 'static'
   45 |         public static void check_TBL(int i,int j,int N)
      |               ^~~~~~~
      |               :
a.cc:58:6: error: expected ';' after class definition
   58 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void DPG3::Program::Main(int*)':
a.cc:15:13: error: 'string' was not declared in this scope
   15 |             string[] input = Console.ReadLine().Split(' ');
      |             ^~~~~~
a.cc:15:20: error: expected primary-expression before ']' token
   15 |             string[] input = Console.ReadLine().Split(' ');
      |                    ^
a.cc:16:21: error: expected primary-expression before 'int'
   16 |             int N = int.Parse(input[0]);
      |                     ^~~
a.cc:17:13: error: 'TBL' was not declared in this scope
   17 |             TBL = new int[N + 1, N + 1]; //テーブルを準備する
      |             ^~~
a.cc:18:13: error: 'DP' was not declared in this scope; did you mean 'DPG3'?
   18 |             DP = new int[N + 1];
      |             ^~
      |             DPG3
a.cc:19:21: error: expected primary-expression before 'int'
   19 |             int M = int.Parse(input[1]);
      |                     ^~~
a.cc:22:24: error: expected primary-expression before ']' token
   22 |                 string[] input_xy = Console.ReadLine().Split(' ');
      |                        ^
a.cc:23:25: error: expected primary-expression before 'int'
   23 |                 int x = int.Parse(input_xy[0]);
      |                         ^~~
a.cc:24:25: error: expected primary-expression before 'int'
   24 |                 int y = int.Parse(input_xy[1]);
      |                         ^~~
a.cc:43:13: error: 'Console' was not declared in this scope
   43 |             Console.WriteLine(DP.Max());
      |             ^~~~~~~
a.cc: In static member function 'static void DPG3::Program::check_TBL(int, int, int)':
a.cc:50:22: error: 'TBL' was not declared in this scope
   50 |                  if (TBL[j,k]!=0)
      |                      ^~~
a.cc:55:27: error: 'DP' was not declared in this scope; did you mean 'DPG3'?
   55 |                 if (tmp > DP[i]) DP[i] = tmp;
      |                           ^~
      |                           DPG3