Language: Java

using System;
using System.Linq;
using System.Collections.Generic;

class Cmondai
{
    static void Main()
    {
        var N = Int32.Parse(Console.ReadLine());
        var dp = new int[N,N];
        for (int i=0;i<N;++i)
        {
            var line = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();
            for (int j=1; j<=N;++j)
            {
                if (i == 0) dp[i, j] = line[j];
                else dp[i, j - 1] = Math.Max(dp[i - 1, j % 3], dp[i - 1, j % 3 + 1]);
            }
        }
        var ans = Math.Max(dp[N-1,0],
            Math.Max(dp[N-1,1],dp[N-1,2]));
        Console.WriteLine(ans);
    }
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
using System;
^
  (use --enable-preview to enable unnamed classes)
Main.java:2: error: class, interface, enum, or record expected
using System.Linq;
^
Main.java:3: error: class, interface, enum, or record expected
using System.Collections.Generic;
^
Main.java:10: error: ']' expected
        var dp = new int[N,N];
                          ^
Main.java:10: error: ';' expected
        var dp = new int[N,N];
                            ^
Main.java:13: error: illegal start of expression
            var line = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();
                                                               ^
Main.java:16: error: ']' expected
                if (i == 0) dp[i, j] = line[j];
                                ^
Main.java:16: error: not a statement
                if (i == 0) dp[i, j] = line[j];
                              ^
Main.java:16: error: not a statement
                if (i == 0) dp[i, j] = line[j];
                                  ^
Main.java:16: error: ';' expected
                if (i == 0) dp[i, j] = line[j];
                                   ^
Main.java:16: error: not a statement
                if (i == 0) dp[i, j] = line[j];
                                           ^
Main.java:17: error: ']' expected
                else dp[i, j - 1] = Math.Max(dp[i - 1, j % 3], dp[i - 1, j % 3 + 1]);
                         ^
Main.java:17: error: not a statement
                else dp[i, j - 1] = Math.Max(dp[i - 1, j % 3], dp[i - 1, j % 3 + 1]);
                       ^
Main.java:17: error: 'else' without 'if'
                else dp[i, j - 1] = Math.Max(dp[i - 1, j % 3], dp[i - 1, j % 3 + 1]);
                ^
Main.java:17: error: not a statement
                else dp[i, j - 1] = Math.Max(dp[i - 1, j % 3], dp[i - 1, j % 3 + 1]);
                             ^
Main.java:17: error: ';' expected
                else dp[i, j - 1] = Math.Max(dp[i - 1, j % 3], dp[i - 1, j % 3 + 1]);
                                ^
Main.java:17: error: ']' expected
                else dp[i, j - 1] = Math.Max(dp[i - 1, j % 3], dp[i - 1, j % 3 + 1]);
                                                     ^
Main.java:17: error: ')' or ',' expected
                else dp[i, j - 1] = Math.Max(dp[i - 1, j % 3], dp[i - 1, j % 3 + 1]);
                                                            ^
Main.java:17: error: ']' expected
                else dp[i, j - 1] = Math.Max(dp[i - 1, j % 3], dp[i - 1, j % 3 + 1]);
                                                                       ^
Main.java:17: error: not a statement
                else dp[i, j - 1] = Math.Max(dp[i - 1, j % 3], dp[i - 1, j % 3 + 1]);
                                                                 ^
Main.java:17: error: not a statement
                else dp[i, j - 1] = Math.Max(dp[i - 1, j % 3], dp[i - 1, j % 3 + 1]);
                                                                               ^
Main.java:17: error: ';' expected
                else dp[i, j - 1] = Math.Max(dp[i - 1, j % 3], dp[i - 1, j % 3 + 1]);
                                                                                  ^
Main.java:20: error: ']' expected
        var ans = Math.Max(dp[N-1,0],
                                 ^
Main.java:20: error: ')' or ',' expected
        var ans = Math.Max(dp[N-1,0],
                                   ^
Main.java:21: error: ']' expected
            Math.Max(dp[N-1,1],dp[N-1,2]));
                           ^
Main.java:21: error: ')' or ',' expected
            Math.Max(dp[N-1,1],dp[N-1,2]));
                             ^
Main.java:21: error: ']' expected
            Math.Max(dp[N-1,1],dp[N-1,2]));
                                     ^
Main.java:21: error: not a statement
            Math.Max(dp[N-1,1],dp[N-1,2]));
                                 ^
28 errors