Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <tuple>
using namespace std;

void print_board(vector<int> board,int W,int H){
  if(0){
  cout <<"-----  board  -----\n";
  for(int h=0;h<H;h++){
    for(int w=0;w<W;w++){
      if(h%2==0){
        cout << board[h*W+w] << " " ;
      }else{
        cout << board[h*W+W-1-w] << " " ;
      }
    }
    cout<<"\n";
  }
  cout <<"-------------------\n";
  }
}

int main(int argc,char** argv){
  int H=0,W=0;
  cin>>H>>W;
  vector<int> board = vector<int>(H*W);

  for(int h=0;h<H;h++){
    for(int w=0;w<W;w++){
      if(h%2==0){
        cin >> board[h*W+w];
      }else{
        cin >> board[h*W+W-1-w];
      }
    }
  }

  string result="";
  int op_size=0;
  vector<tuple<int,int.int.int>> operation_list;
  print_board(board,W,H);
    for(int h=0;h<H;h++){
        for(int w=0;w<W;w++){
            if(board[h*W+w]%2==1 && (h*W+w)<(H*W)-1 ){
                board[h*W+w]--;
                board[h*W+w+1]++;
                op_size++;
                if(h%2==0){
                    if(w==W-1){
                        //oss << h+1 << " " << w+1 <<" "<< h+2 <<" "<< w+1 <<"\n" ;
                        //result += oss.str();
                        operation_list.push_back(make_tuple(h+1,w+1,h+2,w+1));
                    }else{
                        //ostringstream oss;
                        //oss << h+1 << " " << w+1 <<" "<< h+1 <<" "<< w+2 <<"\n" ;
                        //result += oss.str();
                        operation_list.push_back(make_tuple(h+1,w+1,h+1,w+2));
                    }
                    print_board(board,W,H); 
                }else{
                    if(w==W-1){
                        //ostringstream oss;
                        //oss << h+1 << " " << W-w <<" "<< h+2 <<" "<< W-w <<"\n" ;
                        //result += oss.str();
                        operation_list.push_back(make_tuple(h+1,W-w,h+2,W-w));
                    }else{
                        //ostringstream oss;
                        //oss << h+1 << " " << W-w <<" "<< h+1 <<" "<< W-w-1 <<"\n" ;
                        //result += oss.str();
                        operation_list.push_back(make_tuple(h+1,W-w,h+1,W-w-1));
                    }
                    print_board(board,W,H);
                }
            }
        }
    }
  print_board(board,W,H);

  cout << op_size << "\n";
//  cout << result;
    for(int i=0;i<operation_list.size();i++){
        cout << get<0>(operation_list[i]) <<  " " << get<1>(operation_list[i]) << " " << get<2>(operation_list[i]) <<" " << get<3>(operation_list[i]) << "\n";
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:42:31: error: template argument 2 is invalid
   42 |   vector<tuple<int,int.int.int>> operation_list;
      |                               ^~
a.cc:42:34: error: template argument 1 is invalid
   42 |   vector<tuple<int,int.int.int>> operation_list;
      |                                  ^~~~~~~~~~~~~~
a.cc:42:34: error: template argument 2 is invalid
a.cc:54:25: error: 'operation_list' was not declared in this scope
   54 |                         operation_list.push_back(make_tuple(h+1,w+1,h+2,w+1));
      |                         ^~~~~~~~~~~~~~
a.cc:59:25: error: 'operation_list' was not declared in this scope
   59 |                         operation_list.push_back(make_tuple(h+1,w+1,h+1,w+2));
      |                         ^~~~~~~~~~~~~~
a.cc:67:25: error: 'operation_list' was not declared in this scope
   67 |                         operation_list.push_back(make_tuple(h+1,W-w,h+2,W-w));
      |                         ^~~~~~~~~~~~~~
a.cc:72:25: error: 'operation_list' was not declared in this scope
   72 |                         operation_list.push_back(make_tuple(h+1,W-w,h+1,W-w-1));
      |                         ^~~~~~~~~~~~~~
a.cc:83:19: error: 'operation_list' was not declared in this scope
   83 |     for(int i=0;i<operation_list.size();i++){
      |                   ^~~~~~~~~~~~~~