Language: C++

using System;

namespace D_NoNeed {
    class Program {
        static void Main(string[] args) {
            string[] input = Console.ReadLine().Split(' ');
            int N = int.Parse(input[0]);
            int K = int.Parse(input[1]);
            input = Console.ReadLine().Split(' ');
            var A = new int[N];
            for (int i = 0; i < A.Length; i++) 
                A[i] = int.Parse(input[i]);
//            Array.Sort(A);

            bool[,] DP = new bool[N + 1, K];
            for (int i = 0; i <= N; i++)
                for (int j = 0; j < K; j++)
                    DP[i, j] = false;
            DP[0, 0] = true;
            int ans = 0;
            for (int k = 0; k < N; k++) {
                for (int i = 0; i < N; i++) {
                    int a = A[i];
                    if (i == k) {
                        for (int j = 0; j < K; j++) DP[i + 1, j] = DP[i, j];
                    } else {
                        for (int j = 0; j < K; j++) { 
                            DP[i + 1, j] = DP[i, j];
                            if (j - a >= 0) DP[i + 1, j] |= DP[i, j - a];
                        }
                    }
                    // for (int j = 0; j < K; j++) Console.Write(DP[i, j]? "o ": "x ");
                    // Console.WriteLine();
                }
                // for (int j = 0; j < K; j++) Console.Write(DP[N, j]? "o ": "x ");
                // Console.WriteLine();
                bool flag = false;
                for (int j = Math.Max(0,  K - A[k]); j < K; j++) {
                    flag |= DP[N, j];
                }
                if (!flag) ans++;
                // Console.WriteLine();
            }
            Console.WriteLine(ans);
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:5:26: error: 'string' has not been declared
    5 |         static void Main(string[] args) {
      |                          ^~~~~~
a.cc:5:35: error: expected ',' or '...' before 'args'
    5 |         static void Main(string[] args) {
      |                                   ^~~~
a.cc:46:6: error: expected ';' after class definition
   46 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void D_NoNeed::Program::Main(int*)':
a.cc:6:13: error: 'string' was not declared in this scope
    6 |             string[] input = Console.ReadLine().Split(' ');
      |             ^~~~~~
a.cc:6:20: error: expected primary-expression before ']' token
    6 |             string[] input = Console.ReadLine().Split(' ');
      |                    ^
a.cc:7:21: error: expected primary-expression before 'int'
    7 |             int N = int.Parse(input[0]);
      |                     ^~~
a.cc:8:21: error: expected primary-expression before 'int'
    8 |             int K = int.Parse(input[1]);
      |                     ^~~
a.cc:9:13: error: 'input' was not declared in this scope; did you mean 'int'?
    9 |             input = Console.ReadLine().Split(' ');
      |             ^~~~~
      |             int
a.cc:9:21: error: 'Console' was not declared in this scope
    9 |             input = Console.ReadLine().Split(' ');
      |                     ^~~~~~~
a.cc:10:13: error: 'var' was not declared in this scope
   10 |             var A = new int[N];
      |             ^~~
a.cc:11:33: error: 'A' was not declared in this scope
   11 |             for (int i = 0; i < A.Length; i++)
      |                                 ^
a.cc:12:24: error: expected primary-expression before 'int'
   12 |                 A[i] = int.Parse(input[i]);
      |                        ^~~
a.cc:15:18: error: expected identifier before ',' token
   15 |             bool[,] DP = new bool[N + 1, K];
      |                  ^
a.cc:15:18: error: expected ']' before ',' token
a.cc:15:17: error: structured binding declaration cannot have type 'bool'
   15 |             bool[,] DP = new bool[N + 1, K];
      |                 ^
a.cc:15:17: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:15:17: error: empty structured binding declaration
a.cc:15:21: error: expected initializer before 'DP'
   15 |             bool[,] DP = new bool[N + 1, K];
      |                     ^~
a.cc:18:21: error: 'DP' was not declared in this scope
   18 |                     DP[i, j] = false;
      |                     ^~
a.cc:19:13: error: 'DP' was not declared in this scope
   19 |             DP[0, 0] = true;
      |             ^~
a.cc:23:29: error: 'A' was not declared in this scope
   23 |                     int a = A[i];
      |                             ^
a.cc:38:30: error: 'Math' was not declared in this scope
   38 |                 for (int j = Math.Max(0,  K - A[k]); j < K; j++) {
      |                              ^~~~
a.cc:38:47: error: 'A' was not declared in this scope
   38 |                 for (int j = Math.Max(0,  K - A[k]); j < K; j++) {
      |                                               ^