Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <cmath>
#include <cstring>

#define fi first
#define se second
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = 1; i < (n); ++i)
#define drep(i,n) for (int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define all(x) (x).begin(), (x).end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define pb push_back
#define sz(x) (int)(x).size()
#define PQ(T) priority_queue<T, v(T), greater<T> >

using namespace std;
typedef long long ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;

const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;

const int mod = 1000000007;

int fa[88][88];
int fb[88][88];

int dp1[88][88];
int dp2[88][88];

int main() {
    int h, w;
    cin >> h >> w;
    rep(i,h)rep(j,w) cin >> fa[i][j];
    rep(i,h)rep(j,w) cin >> fb[i][j];
    
    if (fa[0][0]>fb[0][0]) {
        dp1[0][0] = fa[0][0];
        dp2[0][0] = fb[0][0];
    } else {
        dp1[0][0] = fb[0][0];
        dp2[0][0] = fa[0][0];
    } 

    for (int i = 0; i<h; ++i) {
        for (int j = 0; j<w; ++j) {
            if (i>1 && j>1) {
                int bs1 = dp1[i-1][j];
                int ss1 = dp2[i-1][j];
                int bs2 = dp1[i][j-1];
                int ss2 = dp2[i][j-1];
                
                int nowb = fa[i][j];
                int nows = fb[i][j];
                if (nowb < nows) swap(nowb,nows);
                if (abs(bs1+nows-ss1-nowb) > abs(bs2+nows-ss2-nowb)) {
                    int newb = bs2+nows;
                    int news = ss2+nowb;
                    if (newb<news) swap(newb,news);
                    dp1[i][j] += newb;
                    dp2[i][j] += news;
                }
                else {
                    int newb = bs1+nows;
                    int news = ss1+nowb;
                    if (newb<news) swap(newb,news);
                    dp1[i][j] += newb;
                    dp2[i][j] += news;


Compiler output:
a.cc: In function 'int main()':
a.cc:78:39: error: expected '}' at end of input
   78 |                     dp2[i][j] += news;
      |                                       ^
a.cc:73:22: note: to match this '{'
   73 |                 else {
      |                      ^
a.cc:78:39: error: expected '}' at end of input
   78 |                     dp2[i][j] += news;
      |                                       ^
a.cc:57:29: note: to match this '{'
   57 |             if (i>1 && j>1) {
      |                             ^
a.cc:78:39: error: expected '}' at end of input
   78 |                     dp2[i][j] += news;
      |                                       ^
a.cc:56:35: note: to match this '{'
   56 |         for (int j = 0; j<w; ++j) {
      |                                   ^
a.cc:78:39: error: expected '}' at end of input
   78 |                     dp2[i][j] += news;
      |                                       ^
a.cc:55:31: note: to match this '{'
   55 |     for (int i = 0; i<h; ++i) {
      |                               ^
a.cc:78:39: error: expected '}' at end of input
   78 |                     dp2[i][j] += news;
      |                                       ^
a.cc:41:12: note: to match this '{'
   41 | int main() {
      |            ^