Language: C++

// Vicfred
// https://atcoder.jp/contests/dp/tasks/dp_d
// dynamic programming
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.stdio;
import std.string;

void main() {
    long N, W;
    readf("%d %d\n", &N, &W);

    long[] ws = new long[N+1];
    long[] vs = new long[N+1];

    long[][] dp = new long[][](10^^5+5, 105);

    foreach(i; 0..N)
        readf("%d %d\n", &ws[i], &vs[i]);

    for(int i = 1; i <= N; i++) {
        for(int j = 1; j <= W; j++) {
            if(j - ws[i - 1] >= 0)
                dp[i][j] = max(dp[i-1][j],
                        dp[i-1][j - ws[i - 1]] + vs[i-1]);
            else
                dp[i][j] = dp[i - 1][j];
        }
    }

    dp[N][W].writeln;
}



Compiler output:
a.cc:20:16: error: too many decimal points in number
   20 |     foreach(i; 0..N)
      |                ^~~~
a.cc:4:1: error: 'import' does not name a type
    4 | import std.algorithm;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import std.array;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import std.conv;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
    7 | import std.math;
      | ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: 'import' does not name a type
    8 | import std.stdio;
      | ^~~~~~
a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: 'import' does not name a type
    9 | import std.string;
      | ^~~~~~
a.cc:9:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:11:1: error: '::main' must return 'int'
   11 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:13:5: error: 'readf' was not declared in this scope
   13 |     readf("%d %d\n", &N, &W);
      |     ^~~~~
a.cc:15:9: error: structured binding declaration cannot have type 'long int'
   15 |     long[] ws = new long[N+1];
      |         ^~
a.cc:15:9: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:15:9: error: empty structured binding declaration
a.cc:15:12: error: expected initializer before 'ws'
   15 |     long[] ws = new long[N+1];
      |            ^~
a.cc:16:9: error: structured binding declaration cannot have type 'long int'
   16 |     long[] vs = new long[N+1];
      |         ^~
a.cc:16:9: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:16:9: error: empty structured binding declaration
a.cc:16:12: error: expected initializer before 'vs'
   16 |     long[] vs = new long[N+1];
      |            ^~
a.cc:18:9: error: structured binding declaration cannot have type 'long int'
   18 |     long[][] dp = new long[][](10^^5+5, 105);
      |         ^~
a.cc:18:9: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:18:9: error: empty structured binding declaration
a.cc:18:11: error: expected initializer before '[' token
   18 |     long[][] dp = new long[][](10^^5+5, 105);
      |           ^
a.cc:20:13: error: 'i' was not declared in this scope
   20 |     foreach(i; 0..N)
      |             ^
a.cc:25:20: error: 'ws' was not declared in this scope
   25 |             if(j - ws[i - 1] >= 0)
      |                    ^~
a.cc:26:17: error: 'dp' was not declared in this scope
   26 |                 dp[i][j] = max(dp[i-1][j],
      |                 ^~
a.cc:27:50: error: 'vs' was not declared in this scope
   27 |                         dp[i-1][j - ws[i - 1]] + vs[i-1]);
      |                                                  ^~
a.cc:26:28: error: 'max' was not declared in this scope
   26 |                 dp[i][j] = max(dp[i-1][j],
      |                            ^~~
a.cc:29:17: error: 'dp' was not declared in this scope
   29 |                 dp[i][j] = dp[i - 1][j];
      |                 ^~
a.cc:33:5: error: 'dp' was not declared in this scope
   33 |     dp[N][W].writeln;
      |     ^~