Language: C++

#include <bits//stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define req(i,n) for(int i = 1;i <=  n; i++)
#define rrep(i,n) for(ll i = n-1;i >= 0;i--)
#define ALL(obj) begin(obj), end(obj)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int main(void) {
    int r, c, k,a,b,d; cin >> r >> c >> k;
    vector<vector<int>> field(r, vector<int>(c, 0));
    rep(i, k) {
        cin >> a >> b >> d; a--; b--;
        field[a][b] = d;
    }vector<vector<vector<ll>>> dp(r+1, vector<vector<ll>>(c+1, vector<ll>(4,0)));
    rep(i, r) rep(j, c) {
        rrep(k, 3) chmax(dp[i][j][k + 1], dp[i][j][k] + field[i][j]); // 多いほうから遷移
        rep(k, 4) {
            chmax(dp[i + 1][j][0], dp[i][j][k]);
            chmax(dp[i][j + 1][k], dp[i][j][k]);
        }
    }ll ans = 0;
    rep(i, 4)chmax(ans,dp[r - 1][c - 1][i]);
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:27: error: 'll' was not declared in this scope
   15 |     }vector<vector<vector<ll>>> dp(r+1, vector<vector<ll>>(c+1, vector<ll>(4,0)));
      |                           ^~
a.cc:15:27: error: template argument 1 is invalid
a.cc:15:27: error: template argument 2 is invalid
a.cc:15:29: error: template argument 1 is invalid
   15 |     }vector<vector<vector<ll>>> dp(r+1, vector<vector<ll>>(c+1, vector<ll>(4,0)));
      |                             ^~
a.cc:15:29: error: template argument 2 is invalid
a.cc:15:31: error: template argument 1 is invalid
   15 |     }vector<vector<vector<ll>>> dp(r+1, vector<vector<ll>>(c+1, vector<ll>(4,0)));
      |                               ^
a.cc:15:31: error: template argument 2 is invalid
a.cc:15:55: error: template argument 2 is invalid
   15 |     }vector<vector<vector<ll>>> dp(r+1, vector<vector<ll>>(c+1, vector<ll>(4,0)));
      |                                                       ^~
a.cc:15:57: error: template argument 1 is invalid
   15 |     }vector<vector<vector<ll>>> dp(r+1, vector<vector<ll>>(c+1, vector<ll>(4,0)));
      |                                                         ^~
a.cc:15:57: error: template argument 2 is invalid
a.cc:15:74: error: template argument 2 is invalid
   15 |     }vector<vector<vector<ll>>> dp(r+1, vector<vector<ll>>(c+1, vector<ll>(4,0)));
      |                                                                          ^
a.cc:15:81: error: expression list treated as compound expression in initializer [-fpermissive]
   15 |     }vector<vector<vector<ll>>> dp(r+1, vector<vector<ll>>(c+1, vector<ll>(4,0)));
      |                                                                                 ^
a.cc:17:14: error: expected ';' before 'k'
   17 |         rrep(k, 3) chmax(dp[i][j][k + 1], dp[i][j][k] + field[i][j]); // 多いほうから遷移
      |              ^
a.cc:5:26: note: in definition of macro 'rrep'
    5 | #define rrep(i,n) for(ll i = n-1;i >= 0;i--)
      |                          ^
a.cc:17:28: error: invalid types 'int[int]' for array subscript
   17 |         rrep(k, 3) chmax(dp[i][j][k + 1], dp[i][j][k] + field[i][j]); // 多いほうから遷移
      |                            ^
a.cc:17:45: error: invalid types 'int[int]' for array subscript
   17 |         rrep(k, 3) chmax(dp[i][j][k + 1], dp[i][j][k] + field[i][j]); // 多いほうから遷移
      |                                             ^
a.cc:19:21: error: invalid types 'int[int]' for array subscript
   19 |             chmax(dp[i + 1][j][0], dp[i][j][k]);
      |                     ^
a.cc:19:38: error: invalid types 'int[int]' for array subscript
   19 |             chmax(dp[i + 1][j][0], dp[i][j][k]);
      |                                      ^
a.cc:20:21: error: invalid types 'int[int]' for array subscript
   20 |             chmax(dp[i][j + 1][k], dp[i][j][k]);
      |                     ^
a.cc:20:38: error: invalid types 'int[int]' for array subscript
   20 |             chmax(dp[i][j + 1][k], dp[i][j][k]);
      |                                      ^
a.cc:22:8: error: expected ';' before 'ans'
   22 |     }ll ans = 0;
      |        ^~~~
      |        ;
a.cc:23:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     rep(i, 4)chmax(ans,dp[r - 1][c - 1][i]);
      |                    ^~~
      |                    abs
a.cc:23:26: error: invalid types 'int[int]' for array subscript
   23 |     rep(i, 4)chmax(ans,dp[r - 1][c - 1][i]);
      |                          ^
a.cc:24:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |     cout << ans << endl;
      |             ^~~
      |             abs