Language: C++

using System;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.IO;

namespace SolutionCS
{
    class Program
    {
        class modMCalc
        {
            private const int M = 998244353;       // 素数(int範囲)

            // 乗算結果 % Mを求める
            static public int Mul(int a, int b)
            {
                return (int)(Math.BigMul(a, b) % M);
            }

            // 冪乗(mod M)
            static public int Pow(int a, int m)
            {
                if (0 == m)
                {
                    return 1;
                }
                if (1 == m)
                {
                    return a;
                }

                int result = 1;
                int param = a;
                for (; m > 0; m >>= 1)
                {
                    if ((m & 0x01) == 1)
                    {
                        result = Mul(result, param);
                    }

                    param = Mul(param, param);
                }

                return result;
            }

            // 除算(mod M)
            static public int Div(int a, int b)
            {
                return Mul(a, Pow(b, M - 2));
            }
        }

        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');

            int[] v = new int[N];
            int maxInd = 0;
            for (int i = 0; i < N; i++)
            {
                int ind = int.Parse(s[i]);
                v[ind]++;

                maxInd = Math.Max(maxInd, ind);
            }

            if(v[0] != 1)
            {
                Console.WriteLine("0");
                return;
            }

            int ans = 1;
            for (int i = 0; i < maxInd; i++)
            {
                int m = modMCalc.Pow(v[i], v[i + 1]);
                ans = modMCalc.Mul(ans, m);
            }

            Console.WriteLine(ans);
        }
    }
}



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.Text;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Numerics;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.IO;
      |       ^~~~~~
a.cc:13:20: error: expected ':' before 'const'
   13 |             private const int M = 998244353;       // 素数(int範囲)
      |                    ^~~~~~
      |                    :
a.cc:16:20: error: expected unqualified-id before 'public'
   16 |             static public int Mul(int a, int b)
      |                    ^~~~~~
a.cc:22:20: error: expected unqualified-id before 'public'
   22 |             static public int Pow(int a, int m)
      |                    ^~~~~~
a.cc:49:20: error: expected unqualified-id before 'public'
   49 |             static public int Div(int a, int b)
      |                    ^~~~~~
a.cc:53:10: error: expected ';' after class definition
   53 |         }
      |          ^
      |          ;
a.cc:55:26: error: 'string' has not been declared
   55 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:55:35: error: expected ',' or '...' before 'args'
   55 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:85:6: error: expected ';' after class definition
   85 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void SolutionCS::Program::Main(int*)':
a.cc:57:21: error: expected primary-expression before 'int'
   57 |             int N = int.Parse(Console.ReadLine());
      |                     ^~~
a.cc:58:13: error: 'string' was not declared in this scope
   58 |             string[] s = Console.ReadLine().Split(' ');
      |             ^~~~~~
a.cc:58:20: error: expected primary-expression before ']' token
   58 |             string[] s = Console.ReadLine().Split(' ');
      |                    ^
a.cc:60:16: error: structured binding declaration cannot have type 'int'
   60 |             int[] v = new int[N];
      |                ^~
a.cc:60:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:60:16: error: empty structured binding declaration
a.cc:60:19: error: expected initializer before 'v'
   60 |             int[] v = new int[N];
      |                   ^
a.cc:64:27: error: expected primary-expression before 'int'
   64 |                 int ind = int.Parse(s[i]);
      |                           ^~~
a.cc:65:17: error: 'v' was not declared in this scope
   65 |                 v[ind]++;
      |                 ^
a.cc:67:26: error: 'Math' was not declared in this scope
   67 |                 maxInd = Math.Max(maxInd, ind);
      |                          ^~~~
a.cc:70:16: error: 'v' was not declared in this scope
   70 |             if(v[0] != 1)
      |                ^
a.cc:72:17: error: 'Console' was not declared in this scope
   72 |                 Console.WriteLine("0");
      |                 ^~~~~~~
a.cc:79:33: error: expected primary-expression before '.' token
   79 |                 int m = modMCalc.Pow(v[i], v[i + 1]);
      |                                 ^
a.cc:79:38: error: 'v' was not declared in this scope
   79 |                 int m = modMCalc.Pow(v[i], v[i + 1]);
      |                                      ^
a.cc:80:31: error: expected primary-expression before '.' token
   80 |                 ans = modMCalc.Mul(ans, m);
      |                               ^
a.cc:83:13: error: 'Console' was not declared in this scope
   83 |             Console.WriteLine(ans);
      |             ^~~~~~~