Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <cmath>
#include <iomanip>
#include <vector>
#include <queue>
#include <functional>
#include <random>
#include <ctime>

using namespace std;
#define RN cout << "\r\n";
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define REP(i, n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef long long int ll;
typedef pair<ll, ll> P;

// combination
const int MAX = 510000;
const int MOD = 1000000007;

ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

long long COM(int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

// gcd, lcm
ll gcd(ll a, ll b) {
    if (b == 0) {
        return a;
    }
    return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
    return a / gcd(a, b) * b;
}


int main() {
    int h, w;
    cin >> h >> w;
    vector<vector<int>> field, ans;
    field = vector<vector<int>>(h, vector<int>(w, 0));
    REP(i, h) {
        REP(j, w) {
            int line;
            cin >> line;
            field[i][j] = line;
        }
    }
    REP(i, h) {
        REP(j, w) {
            int revJ = i % 2 == 1 ? w - j - 1 : j;
            int current = field[i][revJ];
            if (current % 2 == 1) {
                if (i == h - 1 && j == w - 1) {
                } else if (j == w - 1 && i % 2 == 0) {
                    std::vector<int> data({i, j, i + 1, j});
                    ans.push_back(data);
                    field[i + 1][j] += 1;
                } else if (j == w - 1 && i % 2 == 1) {
                    std::vector<int> data({i, revJ, i + 1, revJ});
                    ans.push_back(data);
                    field[i + 1][revJ] += 1;
                } else if (i % 2 == 0) {
                    std::vector<int> data({i, j, i, j + 1});
                    ans.push_back(data);
                    field[i][j + 1] += 1;
                } else {
                    std::vector<int> data({i, revJ, i, revJ - 1});
                    ans.push_back(data);
                    field[i][revJ - 1] += 1;
                }
            }
        }
    }
    cout << ans.size() << endl;
    for (vector<int> line : ans) {
        cout << line[0] + 1 << '' << line[1] + 1 << '' << line[2] + 1 << '' << line[3] + 1 << endl;
    }
    return 0;
}


Compiler output:
a.cc:99:32: error: empty character constant
   99 |         cout << line[0] + 1 << '' << line[1] + 1 << '' << line[2] + 1 << '' << line[3] + 1 << endl;
      |                                ^~
a.cc:99:53: error: empty character constant
   99 |         cout << line[0] + 1 << '' << line[1] + 1 << '' << line[2] + 1 << '' << line[3] + 1 << endl;
      |                                                     ^~
a.cc:99:74: error: empty character constant
   99 |         cout << line[0] + 1 << '' << line[1] + 1 << '' << line[2] + 1 << '' << line[3] + 1 << endl;
      |                                                                          ^~