Language: C++

using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;

using System.Linq;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.Threading; 


class Program
{
	public const int Inf = 1 << 29;
	private static int[,] dp = new int[100,100];
	private static int[,] arrayList = new int[100,100];
	private static int cnt = 0;
	static void Main()
	{
		string line;
		for (int i = 0; i < 100; ++i) {
			for (int j = 0; j < 100; j++) {
				dp[i, j] = -1;
				arrayList[i, j] = -1;
			}
		}
		while (!string.IsNullOrEmpty(line = Console.ReadLine())) {
			string[] s = line.Split(',');
			
			for (int i = 0; i < s.Length; i++)
			{
				arrayList[cnt, i] = int.Parse(s[i]);
			}
			cnt++;
		}
		
		Console.WriteLine(solve(0, 0));
	}

	static int solve(int a, int b)
	{

		if (cnt == a)
		{
			return 0;
		}
		if (b < 0 || arrayList[a,b] == -1)
		{
			return 0;
		}
		if (dp[a,b] >= 0)
		{
			return dp[a,b];
		}
		int res = 0;
		if (cnt / 2 >= a)
		{
			res = Math.Max(solve(a + 1, b) + arrayList[a,b], solve(a + 1, b + 1) + arrayList[a,b]);
		}
		else
		{
			res = Math.Max(solve(a + 1, b) + arrayList[a,b], solve(a + 1, b - 1) + arrayList[a,b]);
		}
		return dp[a,b] = res;
	}
}

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.Text;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'System'
    6 | using System.Linq;
      |       ^~~~~~
a.cc:7:7: error: expected nested-name-specifier before 'System'
    7 | using System.Text.RegularExpressions;
      |       ^~~~~~
a.cc:8:7: error: expected nested-name-specifier before 'System'
    8 | using System.Diagnostics;
      |       ^~~~~~
a.cc:9:7: error: expected nested-name-specifier before 'System'
    9 | using System.Threading;
      |       ^~~~~~
a.cc:14:15: error: expected ':' before 'const'
   14 |         public const int Inf = 1 << 29;
      |               ^~~~~~
      |               :
a.cc:15:16: error: expected ':' before 'static'
   15 |         private static int[,] dp = new int[100,100];
      |                ^~~~~~~
      |                :
a.cc:15:27: error: expected unqualified-id before '[' token
   15 |         private static int[,] dp = new int[100,100];
      |                           ^
a.cc:16:16: error: expected ':' before 'static'
   16 |         private static int[,] arrayList = new int[100,100];
      |                ^~~~~~~
      |                :
a.cc:16:27: error: expected unqualified-id before '[' token
   16 |         private static int[,] arrayList = new int[100,100];
      |                           ^
a.cc:17:16: error: expected ':' before 'static'
   17 |         private static int cnt = 0;
      |                ^~~~~~~
      |                :
a.cc:17:28: error: ISO C++ forbids in-class initialization of non-const static member 'Program::cnt'
   17 |         private static int cnt = 0;
      |                            ^~~
a.cc:66:2: error: expected ';' after class definition
   66 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main()':
a.cc:20:17: error: 'string' was not declared in this scope
   20 |                 string line;
      |                 ^~~~~~
a.cc:23:33: error: 'dp' was not declared in this scope
   23 |                                 dp[i, j] = -1;
      |                                 ^~
a.cc:24:33: error: 'arrayList' was not declared in this scope
   24 |                                 arrayList[i, j] = -1;
      |                                 ^~~~~~~~~
a.cc:27:46: error: 'line' was not declared in this scope
   27 |                 while (!string.IsNullOrEmpty(line = Console.ReadLine())) {
      |                                              ^~~~
a.cc:27:53: error: 'Console' was not declared in this scope
   27 |                 while (!string.IsNullOrEmpty(line = Console.ReadLine())) {
      |                                                     ^~~~~~~
a.cc:28:32: error: expected primary-expression before ']' token
   28 |                         string[] s = line.Split(',');
      |                                ^
a.cc:30:45: error: 's' was not declared in this scope
   30 |                         for (int i = 0; i < s.Length; i++)
      |                                             ^
a.cc:32:33: error: 'arrayList' was not declared in this scope
   32 |                                 arrayList[cnt, i] = int.Parse(s[i]);
      |                                 ^~~~~~~~~
a.cc:32:53: error: expected primary-expression before 'int'
   32 |                                 arrayList[cnt, i] = int.Parse(s[i]);
      |                                                     ^~~
a.cc:37:17: error: 'Console' was not declared in this scope
   37 |                 Console.WriteLine(solve(0, 0));
      |                 ^~~~~~~
a.cc: In static member function 'static int Program::solve(int, int)':
a.cc:47:30: error: 'arrayList' was not declared in this scope
   47 |                 if (b < 0 || arrayList[a,b] == -1)
      |                              ^~~~~~~~~
a.cc:51:21: error: 'dp' was not declared in this scope
   51 |                 if (dp[a,b] >= 0)
      |                     ^~
a.cc:58:31: error: 'Math' was not declared in this scope
   58 |                         res = Math.Max(solve(a + 1, b) + arrayList[a,b], solve(a + 1, b + 1) + arrayList[a,b]);
      |                               ^~~~
a.cc:58:58: error: 'arrayList' was not declared in this scope
   58 |                         res = Math.Max(solve(a + 1, b) + arrayList[a,b], solve(a + 1, b + 1) + arrayList[a,b]);
      |                                                          ^~~~~~~~~
a.cc:62:31: error: 'Math' was not declared in this scope
   62 |                         res = Math.Max(solve(a + 1, b) + arrayList[a,b], solve(a + 1, b - 1) + arrayList[a,b]);
      |                               ^~~~
a.cc:62:58: error: 'arrayList' was not declared in this scope
   62 |                         res = Math.Max(solve(a + 1, b) + arrayList[a,b], solve(a + 1, b - 1) + arrayList[a,b]);
      |                                                          ^~~~~~~~~
a.cc:64:24: error: 'dp' was not declared in this scope
   64 |                 return dp[a,b] = res;
      |                        ^~