criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<(long long)(n);++(i))
using ll = long long;
using P = pair<int, int>;
using namespace std;

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int a[501][501];

int main() {
    int h, w;
    cin >> h >> w;
    rep(i, h) rep(j, w) cin >> a[i][j];
    vector<pair<P, P>> ans;
    rep(i, h) {
        if (i%2==0) {
            rep(j, w) {
                if (j != w-1) {
                    if (a[i][j]%2) {
                        P a(i, j), b(i, j+1);
                        ans.emplace_back(a, b);
                        a[i][j+1]++;
                    }
                }
                else {
                    if (a[i][j]%2 and i+1<h) {
                        P a(i, j), b(i+1, j);
                        a[i+1][j]++;
                        ans.emplace_back(a, b);
                    }
                }
            }
        }
        else {
            for (int j=w-1; j>=0; --j) {
                if (j != 0) {
                    if (a[i][j]%2) {
                        P a(i, j), b(i, j-1);
                        ans.emplace_back(a, b);
                        a[i][j-1]++;
                    }
                }
                else {
                    if (a[i][j]%2 and i+1<h) {
                        P a(i, j), b(i+1, j);
                        a[i+1][j]++;
                        ans.emplace_back(a, b);
                    }
                }
            }
        }
    }

    cout << ans.size() << endl;
    for (auto& t : ans) {
        P a = t.first, b = t.second;
        cout << a.first+1 << ' ' << a.second+1 << ' ' << b.first+1 << ' ' << b.second+1 << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: no match for 'operator[]' (operand types are 'P' {aka 'std::pair<int, int>'} and 'int')
   29 |                         a[i][j+1]++;
      |                          ^
a.cc:35:26: error: no match for 'operator[]' (operand types are 'P' {aka 'std::pair<int, int>'} and 'int')
   35 |                         a[i+1][j]++;
      |                          ^
a.cc:47:26: error: no match for 'operator[]' (operand types are 'P' {aka 'std::pair<int, int>'} and 'int')
   47 |                         a[i][j-1]++;
      |                          ^
a.cc:53:26: error: no match for 'operator[]' (operand types are 'P' {aka 'std::pair<int, int>'} and 'int')
   53 |                         a[i+1][j]++;
      |                          ^
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
  int h,w;
  scanf("%d",&h);
  scanf("%d",&w);
  int a[h][w];
  int i,j;
  for(i=0;i<h;i++) {
    for(j=0;j<w;j++) {
      scanf("%d",&a[i][j]);
    }
  }
  for(i=0;i<h;i++) {
    for(j=0;j<w-1;j++) {
      if(a[i][j]%2!=0) {
        a[i][j]--;
        a[i][j+1]++;
        printf("%d %d %d %d\n",i+1,j+1,i+1,j+1+1);
      }
    }
  }
  for(i=0;i<h-1;i++) {
    if(a[i][w-1]%2!=0) {
      a[i][w-1]--;
      a[i+1][w-1]++;
      printf("%d %d %d %d\n",i+1,w-1+1,i+1+1,w-1+1x);
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:50: error: unable to find numeric literal operator 'operator""x'
   29 |       printf("%d %d %d %d\n",i+1,w-1+1,i+1+1,w-1+1x);
      |                                                  ^~
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int w = sc.nextInt();
    int[][] a = new int[h][w];

    for (int i=0;i<h;++i){
      for (int j=0;j<w;++j){
        a[i][j] =sc.nextInt();
      }
    }

    int n = 0;
    ArrayList<int[]> list = new ArrayList<int[]>();

    for(int i = 0; i < h; i++) {
        if(i % 2 == 0) {
          for(int j = 0; j < w; j++) {
            if((i + j) < h + w - 2) {
              if(a[i][j] % 2 == 1) {
                int[] s = {i, j};
                int[] t = new int[2];
                list.add(s);
                n++;
                if(j < w - 1) {
                  a[i][j + 1]++;
                  t[0] = i;
                  t[1] = j + 1;
                } else {
                  a[i + 1][j]++;
                  t[0] = i + 1;
                  t[1] = j;
                }
                list.add(t);
              }
            }
          }
        }   else {
            for(int j = w - 1; j >= 0; j--) {
              if((i + j) < h + w - 2) {
                if(a[i][j] % 2 == 1) {
                  int[] s = {i, j};
                  int[] t = new int[2];
                  list.add(s);
                  n++;
                  if(j > 0) {
                    a[i][j - 1]++;
                    t[0] = i;
                    t[1] = j - 1;
                  } else {
                    a[i + 1][j]++;
                    t[0] = i + 1;
                    t[1] = j;
                  }
                  list.add(t);
                }
              }
            }
          }
        }
      }

    System.out.println(n);

    for(int i = 0; i < list.size() - 1; i++) {
      int[] s = list.get(i);
      int[] t = list.get(i + 1);
      System.out.print(s[0]);
      System.out.print(" ");
      System.out.print(s[1]);
      System.out.print(" ");
      System.out.print(t[0]);
      System.out.print(" ");
      System.out.print(t[1]);
      System.out.println();
    }

  }
}

Compiler output:
Main.java:66: error: <identifier> expected
    System.out.println(n);
                      ^
Main.java:66: error: <identifier> expected
    System.out.println(n);
                        ^
Main.java:68: error: illegal start of type
    for(int i = 0; i < list.size() - 1; i++) {
    ^
Main.java:68: error: > or ',' expected
    for(int i = 0; i < list.size() - 1; i++) {
                                ^
Main.java:68: error: ';' expected
    for(int i = 0; i < list.size() - 1; i++) {
                                  ^
Main.java:68: error: <identifier> expected
    for(int i = 0; i < list.size() - 1; i++) {
                                         ^
Main.java:82: error: class, interface, enum, or record expected
}
^
7 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int w = sc.nextInt();
    int[][] a = new int[h][w];

    for (int i=0;i<h;++i){
      for (int j=0;j<w;++j){
        a[i][j] =sc.nextInt();
      }
    }

    int n = 0;
    ArrayList<int[]> list = new ArrayList<int[]>();

    for(int i = 0; i < h; i++) {
        if(i % 2 == 0) {
          for(int j = 0; j < w; j++) {
            if((i + j) < h + w - 2) {
              if(a[i][j] % 2 == 1) {
                int[] s = {i, j};
                int[] t = new int[2];
                list.add(s);
                n++;
                if(j < w - 1) {
                  a[i][j + 1]++;
                  t[0] = i;
                  t[1] = j + 1;
                } else {
                  a[i + 1][j]++;
                  t[0] = i + 1;
                  t[1] = j;
                }
                list.add(t);
              }
            }
          } else {
            for(int j = w - 1; j >= 0; j--) {
              if((i + j) < h + w - 2) {
                if(a[i][j] % 2 == 1) {
                  int[] s = {i, j};
                  int[] t = new int[2];
                  list.add(s);
                  n++;
                  if(j > 0) {
                    a[i][j - 1]++;
                    t[0] = i;
                    t[1] = j - 1;
                  } else {
                    a[i + 1][j]++;
                    t[0] = i + 1;
                    t[1] = j;
                  }
                  list.add(t);
                }
              }
            }
          }
        }
      }

    System.out.println(n);

    for(int i = 0; i < list.size() - 1; i++) {
      int[] s = list.get(i);
      int[] t = list.get(i + 1);
      System.out.print(s[0]);
      System.out.print(" ");
      System.out.print(s[1]);
      System.out.print(" ");
      System.out.print(t[0]);
      System.out.print(" ");
      System.out.print(t[1]);
      System.out.println();
    }

  }
}

Compiler output:
Main.java:40: error: 'else' without 'if'
          } else {
            ^
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int w = sc.nextInt();
    int[][] a = new int[h][w];

    for (int i=0;i<h;++i){
      for (int j=0;j<w;++j){
        a[i][j] =sc.nextInt();
      }
    }

    int n = 0;
    ArrayList<int[]> list = new ArrayList<int[]>();

    for(int i = 0; i < h; i++) {
      if((i + j) < h + w - 2) {
        if(i % 2 == 0) {
          for(int j = 0; j < w; j++) {
            if((i + j) < h + w - 2) {
              if(a[i][j] % 2 == 1) {
                int[] s = {i, j};
                int[] t = new int[2];
                list.add(s);
                n++;
                if(j < w - 1) {
                  a[i][j + 1]++;
                  t[0] = i;
                  t[1] = j + 1;
                } else {
                  a[i + 1][j]++;
                  t[0] = i + 1;
                  t[1] = j;
                }
                list.add(t);
              }
            }
          } else {
            for(int j = w - 1; j >= 0; j--) {
              if((i + j) < h + w - 2) {
                if(a[i][j] % 2 == 1) {
                  int[] s = {i, j};
                  int[] t = new int[2];
                  list.add(s);
                  n++;
                  if(j > 0) {
                    a[i][j - 1]++;
                    t[0] = i;
                    t[1] = j - 1;
                  } else {
                    a[i + 1][j]++;
                    t[0] = i + 1;
                    t[1] = j;
                  }
                  list.add(t);
                }
              }
            }
          }
        }
      }

    System.out.println(n);

    for(int i = 0; i < list.size() - 1; i++) {
      int[] s = list.get(i);
      int[] t = list.get(i + 1);
      System.out.print(s[0]);
      System.out.print(" ");
      System.out.print(s[1]);
      System.out.print(" ");
      System.out.print(t[0]);
      System.out.print(" ");
      System.out.print(t[1]);
      System.out.println();
    }

  }
}

Compiler output:
Main.java:41: error: 'else' without 'if'
          } else {
            ^
Main.java:82: error: reached end of file while parsing
}
 ^
2 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int w = sc.nextInt();
    int[][] a = new int[h][w];

    for (int i=0;i<h;++i){
      for (int j=0;j<w;++j){
        a[i][j] =sc.nextInt();
      }
    }

    int n = 0;
    ArrayList<int[]> list = new ArrayList<int[]>();

    for(int i = 0; i < h; i++) {
      if((i + j) < h + w - 2) {
        if(i % 2 == 0) {
          for(int j = 0; j < w; j++) {
            if((i + j) < h + w - 2) {
              if(a[i][j] % 2 == 1) {
                int[] s = {i, j};
                int[] t = new int[2];
                list.add(s);
                n++;
                if(j < w - 1) {
                  a[i][j + 1]++;
                  t = {i, j + 1};
                } else {
                  a[i + 1][j]++;
                  t = {i + 1, j};
                }
                list.add(t);
              }
            }
          } else {
            for(int j = w - 1; j >= 0; j--) {
              if((i + j) < h + w - 2) {
                if(a[i][j] % 2 == 1) {
                  int[] s = {i, j};
                  list.add(s);
                  n++;
                  if(j > 0) {
                    a[i][j - 1]++;
                    int[] t = {i, j - 1};
                  } else {
                    a[i + 1][j]++;
                    int[] t = {i + 1, j};
                  }
                  list.add(t);
                }
              }
            }
          }
        }
      }

    System.out.println(n);

    for(int i = 0; i < list.size() - 1; i++) {
      int[] s = list.get(i);
      int[] t = list.get(i + 1);
      System.out.print(s[0]);
      System.out.print(" ");
      System.out.print(s[1]);
      System.out.print(" ");
      System.out.print(t[0]);
      System.out.print(" ");
      System.out.print(t[1]);
      System.out.println();
    }

  }
}

Compiler output:
Main.java:31: error: illegal start of expression
                  t = {i, j + 1};
                      ^
Main.java:31: error: not a statement
                  t = {i, j + 1};
                       ^
Main.java:31: error: ';' expected
                  t = {i, j + 1};
                        ^
Main.java:31: error: not a statement
                  t = {i, j + 1};
                            ^
Main.java:31: error: ';' expected
                  t = {i, j + 1};
                               ^
Main.java:34: error: illegal start of expression
                  t = {i + 1, j};
                      ^
Main.java:34: error: not a statement
                  t = {i + 1, j};
                         ^
Main.java:34: error: ';' expected
                  t = {i + 1, j};
                            ^
Main.java:34: error: not a statement
                  t = {i + 1, j};
                              ^
Main.java:34: error: ';' expected
                  t = {i + 1, j};
                               ^
Main.java:39: error: 'else' without 'if'
          } else {
            ^
Main.java:77: error: reached end of file while parsing
}
 ^
12 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int w = sc.nextInt();
    int[][] a = new int[h][w];

    for (int i=0;i<h;++i){
      for (int j=0;j<w;++j){
        a[i][j] =sc.nextInt();
      }
    }

    int n = 0;
    ArrayList<int[]> list = new ArrayList<int[]>();

    for(int i = 0; i < h; i++) {
      if((i + j) < h + w - 2) {
        if(i % 2 == 0) {
          for(int j = 0; j < w; j++) {
            if(a[i][j] % 2 == 1) {
              int[] s = {i, j};
              list.add(s);
              n++;
              if(j < w - 1) {
                a[i][j + 1]++;
                int[] t = {i, j + 1};
              } else {
                a[i + 1][j]++;
                int[] t = {i + 1, j};
              }
              list.add(t);
            }
          }
        } else {
          for(int j = w - 1; j >= 0; j--) {
            if(a[i][j] % 2 == 1) {
              int[] s = {i, j};
              list.add(s);
              n++;
              if(j > 0) {
                a[i][j - 1]++;
                int[] t = {i, j - 1};
              } else {
                a[i + 1][j]++;
                int[] t = {i + 1, j};
              }
              list.add(t);
            }
          }
        }
      }
    }

    System.out.println(n);

    for(int i = 0; i < list.size() - 1; i++) {
      int[] s = list.get(i);
      int[] t = list.get(i + 1);
      System.out.print(s[0]);
      System.out.print(" ");
      System.out.print(s[1]);
      System.out.print(" ");
      System.out.print(t[0]);
      System.out.print(" ");
      System.out.print(t[1]);
      System.out.println();
    }

  }
}

Compiler output:
Main.java:20: error: cannot find symbol
      if((i + j) < h + w - 2) {
              ^
  symbol:   variable j
  location: class Main
Main.java:34: error: cannot find symbol
              list.add(t);
                       ^
  symbol:   variable t
  location: class Main
Main.java:50: error: cannot find symbol
              list.add(t);
                       ^
  symbol:   variable t
  location: class Main
3 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+5;
int x1[maxn],x2[maxn],y1[maxn],y2[maxn]; 
int main()
{
	int h,w,a[500][500],i,j,n=0;
	scanf("%d%d",&h,&w);
	for(i=1;i<=h;i++){
		for(j=1;j<=w;j++)
			scanf("%d",&a[i][j]);
	}
	for(i=1;i<=h;i++){
		for(j=1;j<w;j++){
			if(a[i][j]%2==1){
			y1[n]=i;
			y2[n]=i;
			x1[n]=j;
			x2[n]=j+1;
			n++;
			a[i][j]--;
			a[i][j+1]++;
			}
		}
	}
	for(i=1;i<h;i++){
		if(a[i][w]%2==1){
			y1[n]=i;
			y2[n]=i+1;
			x1[n]=w;
			x2[n]=w;
			n++;
			a[i][w]--;
			a[i+1][w]++;
		}
	}
	printf("%d\n",n);
	for(i=0;i<n;i++)
		printf("%d %d %d %d\n",y1[i],x1[i],y2[i],x2[i]);
	return 0;
} 



Compiler output:
a.cc:4:30: error: 'int y1 [100005]' redeclared as different kind of entity
    4 | int x1[maxn],x2[maxn],y1[maxn],y2[maxn];
      |                              ^
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
  257 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:16:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   16 |                         y1[n]=i;
      |                             ^
a.cc:16:30: error: assignment of read-only location '*(y1 + ((sizetype)n))'
   16 |                         y1[n]=i;
      |                         ~~~~~^~
a.cc:28:29: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |                         y1[n]=i;
      |                             ^
a.cc:28:30: error: assignment of read-only location '*(y1 + ((sizetype)n))'
   28 |                         y1[n]=i;
      |                         ~~~~~^~
a.cc:39:44: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   39 |                 printf("%d %d %d %d\n",y1[i],x1[i],y2[i],x2[i]);
      |                                            ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<string>
#include<math.h>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<time.h>
#include<ctime>
#include<functional>
#define int long long
#define itn int
#define INF (1<<29)
#define f(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
using namespace std;

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;
}

ll mypow(ll a, ll b, ll c) {
	if (b == 0)return 1;
	if (b % 2)return mypow(a, b - 1, c)*a%c;
	else return mypow(a, b / 2, c)*mypow(a, b / 2, c) % c;
}

int main(){
	queue<int> q;
	int h,w,a[500][500];
	cin >> h >> w;
	f(i, h) {
		f(j, w) {
			cin >> a[i][j];
		}
	}
	f(i, h) {
		f(j, w) {
			if (a[i][j] % 2) {
				if (j + 1 == w) {
					if (i + 1 != h) {
						a[i][j]--;
						a[i + 1][j]++;
						q.push(i);
						q.push(j);
						q.push(i + 1);
						q.push(j);
					}
				}
				else {
					a[i][j]--;
					a[i][j + 1]++;
					q.push(i);
					q.push(j);
					q.push(i);
					q.push(j + 1);
				}
			}
		}
	}
	cout << q.size() / 4 << endl;
	f(i, q.size()) {
		cout << q.front() << " ";
		q.pop();
	}
	return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include "stdafx.h"

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;


void disp(vector<vector <int> > table)
{
	cout << "\n";
	for (int ri = 0; ri < table.size(); ri++) {
		for (int ci = 0; ci < table[0].size(); ci++) {
			cout << table[ri][ci] << " ";
		}
		cout << "\n";
	}
}

int main()
{
	int H, W;

	cin >> H >> W;

	vector<vector <int> > table;

	for (int hi = 0; hi < H; hi++) {
		int a;
		vector<int> line;
		for (int wi = 0; wi < W; wi++) {
			cin >> a;
			line.push_back(a);
		}
		table.push_back(line);
	}

	int cnt = 0;
	vector<string> ans;
	for (int ri = 0; ri < H; ri++) {
		for (int ci = 0; ci < W -1; ci++) {
			if (table[ri][ci] % 2 == 1) {
				table[ri][ci]--;
				table[ri][ci+1]++;
				cnt++;
				string line = to_string(ri + 1) + " " + to_string(ci + 1) + " " + to_string(ri + 1) + " " + to_string(ci + 2);
				ans.push_back(line);
				//disp(table);
			}
		}
	}

	int ci = W - 1;
	for (int ri = 0; ri < H-1; ri++) {
		if (table[ri][ci] % 2 == 1) {
			table[ri][ci]--;
			table[ri+1][ci]++;
			cnt++;
			string line = to_string(ri + 1) + " " + to_string(ci + 1) + " " + to_string(ri + 2) + " " + to_string(ci + 1);
			ans.push_back(line);
			//disp(table);
		}
	}


	printf("%d\n", cnt);
	for (auto s : ans) {
		printf("%s\n", s.c_str());
	}


	return 0;
}



Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> pii;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i))
#define mat(type, c, m, n) vector<vector<type>> c(m, vector<type>(n));for(auto& r:c)for(auto& i:r)cin>>i;
#define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define rrep(i,a,n) for(int i=(a), i##_len=(n); i>i##_len; --i)
#define each(x,y) for(auto &(x):(y))
#define var(type, ...)type __VA_ARGS__;Scan(__VA_ARGS__);
template<typename T> void Scan(T& t) { cin >> t; }
template<typename First, typename...Rest>void Scan(First& first, Rest&...rest) { cin >> first; Scan(rest...); }
#define vec(type, c, n) vector<type> c(n);for(auto& i:c) cin>>i;
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
#define em emplace
#define pb pop_back
#define fi first
#define se second
#define get(a, i) get<i>(a)
#define bit_count __builtin_popcount
#define mt make_tuple
inline string zero(int a,string s,char c='0'){return string(a-len(s),c)+s;}
inline string zero(int a,int t,char c='0'){return zero(a, to_string(t), c);}
inline string zero(int a,ll t,char c='0'){return zero(a, to_string(t), c);}
#define mini min_element
#define maxi max_element
#define sum accumulate
#define chmax(a,b) if(a<b)a=b
#define chmin(a,b) if(a>b)a=b
template <class T> inline void print(T t){cout << t << \n;}
template <class H, class... T> inline void print(H h, T... t){cout << h << " ";print(t...);}
int v[510][510];
int ans[100000][4];
void solve() {
	var(int, h, w);
	rep(i, 1, h + 1) {
		rep(j, 1, w + 1) {
			cin >> v[i][j];
		}
	}
	int c = 0;
	rep(i, 1, h) {
		rep(j, 1, w + 1) {
			if (v[i][j] & 1) {
				ans[c][0] = i;
				ans[c][1] = j;
				ans[c][2] = i + 1;
				ans[c][3] = j;
				++c;
				++v[i + 1][j];
			}
		}
	}
	rep(j, 1, w) {
		if (v[h][j] & 1) {
			ans[c][0] = h;
			ans[c][1] = j;
			ans[c][2] = h;
			ans[c][3] = j + 1;
			++c;
			++v[h][j + 1];
		}
	}
	print(c);
	rep(i, 0, c) {
		print(ans[i][0], ans[i][1], ans[i][2], ans[i][3]);
	}
}
int main() {
	solve();
	return 0;
}


Compiler output:
a.cc:41:56: error: stray '\' in program
   41 | template <class T> inline void print(T t){cout << t << \n;}
      |                                                        ^
a.cc: In function 'void print(T)':
a.cc:41:57: error: 'n' was not declared in this scope
   41 | template <class T> inline void print(T t){cout << t << \n;}
      |                                                         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define INF 1e9

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int H, W;
    scanf("%d%d", &H, &W);

    int x[510][510];
    for (int i = 1; i <= H; i++) {
        for (int j = 1; j <= W; j++) {
            scanf("%d", &x[i][])
        }
    }

    int num = 0;
    int ans[300000][5];
    for (int i = 1; i <= H; i++) {
        for (int j = 1; j <= W-1; j++) {
            if (x[i][j] % 2 == 1) {
                x[i][j+1]++;
                num++;
                ans[num][1] = i;
                ans[num][2] = j;
                ans[num][3] = i;
                ans[num][4] = j+1;
            }
        }
    }

    for (int i = 1; i <= H-1; i++) {
        if (x[i][W]%2 == 1) {
            x[i+1][W]++;
            num++;
            ans[num][1] = i;
            ans[num][2] = W;
            ans[num][3] = i+1;
            ans[num][4] = W;
        }
    }

    cout << num << endl;
	for(int i=1;i<=num;i++) cout<<ans[i][1]<<" "<<ans[i][2]<<" "<<ans[i][3]<<" "<<ans[i][4]<<"\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:31: error: expected primary-expression before ']' token
   17 |             scanf("%d", &x[i][])
      |                               ^
Language: C++

#include <iostream>
#include <vector>
#include <map>

using namespace std;

int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<int>> A(H, vector<int>(W));
  for(int i = 0; i < H; i++) {
  	for(int j = 0; j < W; j++) {
      cin >> A[i][j];
    }
  }
  vector<pair<pair<int,int>, pair<int,int>>> ans;
  for(int i = 0; i < H; i++) {
  	for(int j = 0; j < W - 1; j++) {
      if (A[i][j] % 2 == 1) {
      	ans.push_back({{i, j}, {i, j + 1}});
        A[i][j]--;
        A[i][j + 1]++;
      }
    }
  }
  for(int i = 0; i < H - 1; i++) {
  	if (A[i].back() % 2 == 1) {
      ans.push_back({i, W - 1}, {i + 1, W - 1});
      A[i].back()--;
      A[i + 1].back()++;
    }
  }
  cout << ans.size() << endl;
  for(int i = 0; i < ans.size(); i++) {
  	cout << ans[i].first.first << " " << ans[i].first.second << " " << ans[i].second.first << " " << ans[i].second.second << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:20: error: no matching function for call to 'std::vector<std::pair<std::pair<int, int>, std::pair<int, int> > >::push_back(<brace-enclosed initializer list>, <brace-enclosed initializer list>)'
   28 |       ans.push_back({i, W - 1}, {i + 1, W - 1});
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<std::pair<int, int>, std::pair<int, int> >; _Alloc = std::allocator<std::pair<std::pair<int, int>, std::pair<int, int> > >; value_type = std::pair<std::pair<int, int>, std::pair<int, int> >]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<std::pair<int, int>, std::pair<int, int> >; _Alloc = std::allocator<std::pair<std::pair<int, int>, std::pair<int, int> > >; value_type = std::pair<std::pair<int, int>, std::pair<int, int> >]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
Language: C++

#include<stdio.h>
int main(){
int h,w,a[555][555],i,j,n=0,x1[200000],x2[200000],y1[200000],y2[200000];
scanf("%d%d",&h,&w);
for(i=1;i<=h;i++){
for(j=1;j<=w;j++)
scanf("%d",&a[i][j]);
}
for(i=1;i<=h;i++){
for(j=1;j<w;j++){
if(a[i][j]%2==1){
y1[n]=i;
y2[n]=i;
x1[n]=j;
x2[n]=j+1;
n++;
a[i][j]--;
a[i][j+1]++;
}
for(i=1;i<h;i++){
if(a[i][w]%2==1){
y1[n]=i;
y2[n]=i+1;
x1[n]=w;
x2[n]=w;
n++;
a[i][w]--;
a[i+1][w]++;
}
}
printf("%d\n",n);
for(i=0;i<n;i++)
printf("%d %d %d %d\n",y1[i],x1[i],y2[i],x2[i]);
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:2: error: expected '}' at end of input
   35 | }
      |  ^
a.cc:9:18: note: to match this '{'
    9 | for(i=1;i<=h;i++){
      |                  ^
a.cc:35:2: error: expected '}' at end of input
   35 | }
      |  ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C

#include <stdio.h>

typedef struct{
    long y;
    long x;
} pos_t;

char a[512*512];
char out[1024*1024];

inline static long s(long y, long x, long w){
    if(y%2==0){
        return y*w+x;
    }else{
        return y*w+(w-1-x);
    }
}

inline static pos_t xy(long n, long w){
    long q = n/w;
    long r = n%w;
    pos_t t;
    t.y = q+1;
    if(q%2==0){
        t.x = r+1;
    }else{
        t.x = w-r;
    }
    return t;
}

int main(void){
    long h, w;
    scanf("%ld %ld\n", &h, &w);
    for(long i=0; i<h; i++){
        for(long j=0; j<w; j++){
            int t;
            scanf("%d", &t);
            a[s(i,j,w)] = t;
        }
    }
    bool haveCoin = false;
    long count = 0;
    size_t pos = 0;
    for(long i=0; i<h*w-1; i++){
        if(a[i]%2==1){
            haveCoin = !haveCoin;
        }
        if(haveCoin){
            const pos_t p=xy(i, w);
            const pos_t q=xy(i+1, w);
            size_t len = sprintf(out+pos, "%ld %ld %ld %ld\n", p.y, p.x, q.y, q.x);
            pos += len;
            count++;
        }
    }
    printf("%ld\n", count);
    fputs(out, stdout);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:42:5: error: unknown type name 'bool'
   42 |     bool haveCoin = false;
      |     ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:42:21: error: 'false' undeclared (first use in this function)
   42 |     bool haveCoin = false;
      |                     ^~~~~
main.c:42:21: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:42:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

typedef struct{
    long y;
    long x;
} pos_t;

char a[512*512];
char out[1024*1024];

inline static long s(long y, long x, long w){
    if(y%2==0){
        return y*w+x;
    }else{
        return y*w+(w-1-x);
    }
}

inline static pos_t xy(long n, long w){
    long q = n/w;
    long r = n%w;
    if(q%2==0){
        return {q+1,r+1};
    }else{
        return {q+1,w-r};
    }
}

int main(void){
    long h, w;
    scanf("%ld %ld\n", &h, &w);
    for(long i=0; i<h; i++){
        for(long j=0; j<w; j++){
            int t;
            scanf("%d", &t);
            a[s(i,j,w)] = t;
        }
    }
    bool haveCoin = false;
    long count = 0;
    size_t pos = 0;
    for(long i=0; i<h*w-1; i++){
        if(a[i]%2==1){
            haveCoin = !haveCoin;
        }
        if(haveCoin){
            const pos_t p=xy(i, w);
            const pos_t q=xy(i+1, w);
            size_t len = sprintf(out+pos, "%ld %ld %ld %ld\n", p.y, p.x, q.y, q.x);
            pos += len;
            count++;
        }
    }
    printf("%ld\n", count);
    fputs(out, stdout);
    return 0;
}


Compiler output:
main.c: In function 'xy':
main.c:23:16: error: expected expression before '{' token
   23 |         return {q+1,r+1};
      |                ^
main.c:25:16: error: expected expression before '{' token
   25 |         return {q+1,w-r};
      |                ^
main.c: In function 'main':
main.c:39:5: error: unknown type name 'bool'
   39 |     bool haveCoin = false;
      |     ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:39:21: error: 'false' undeclared (first use in this function)
   39 |     bool haveCoin = false;
      |                     ^~~~~
main.c:39:21: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:39:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<stdio.h>
int main(){
int h,w,a[555][555],i,j,n=0,x1[200000],x2[200000],y1[200000],y2[200000];
scanf("%d%d",&h,&w);
for(i=1;i<=h;i++){
for(j=1;j<=w;j++)
scanf("%d",&a[i][j]);
}
for(i=1;i<=h;i++){
for(j=1;j<w;j++){
if(a[i][j]%2==1){
y1[n]=i;
y2[n]=i;
x1[n]=j;
x2[n]=j+1;
n++;
a[i][j]--;
a[i][j+1]++;
}
for(i=1;i<h;i++){
if(a[i][w]%2==1){
y1[n]=i;
y2[n]=i+1;
x1[n]=w;
x2[n]=w;
n++;
a[i][w]--;
a[i+1][w]++;
}
}
printf("%d\n",n);
for(i=0;i<n;i++)
scanf("%d %d %d %d\n",y1[i],x1[i],y2[i],x2[i]);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:2: error: expected '}' at end of input
   35 | }
      |  ^
a.cc:9:18: note: to match this '{'
    9 | for(i=1;i<=h;i++){
      |                  ^
a.cc:35:2: error: expected '}' at end of input
   35 | }
      |  ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i,s,e) for(int i=(s);i<(e);i++)
#define REP(i,n) FOR(i,0,n)
#define all(v) (v).begin(),(v).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
using namespace std;
typedef long long LL;
typedef pair<int, int> P;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int H, W;
    cin >> H >> W;

    vector<vector<int> > a(H, vector<int>(W, 0);
    REP(i, H)REP(j, W) cin >> a[i][j];
    vector<vector<int> > step(H*W, vector<int>(4, 0);
    int ans = 0;
    REP(i, H)REP(j, W-1){
        if(a[i][j] % 2){
            step[ans][0] = i;
            step[ans][2] = i;
            step[ans][1] = j;
            step[ans][3] = j+1;
            ++ans;
            a[i][j]--;
            a[i][j+1]++;
        }
    }

    REP(i, H-1){
        int j = W-1;
        if(a[i][j] % 2){
            step[ans][0] = i;
            step[ans][2] = i+1;
            step[ans][1] = j;
            step[ans][3] = j;
            ++ans;
            a[i][j]--;
            a[i+1][j]++;
        }
    }

    cout << ans << endl;
    REP(i, ans)REP(j, 4) cout << step[i][j]+1 << (j==3 ? "\n":" ");

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:48: error: expected ')' before ';' token
   18 |     vector<vector<int> > a(H, vector<int>(W, 0);
      |                           ~                    ^
      |                                                )
a.cc:20:53: error: expected ')' before ';' token
   20 |     vector<vector<int> > step(H*W, vector<int>(4, 0);
      |                              ~                      ^
      |                                                     )
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<cmath>
 
using namespace std;
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define SWAP(a,b) (a += b,b = a - b,a -= b)
#define ll long long

const int MOD = 1e9 + 7;

int main() {
    vector<vector<int>> map;
    int a[10000], b[10000],dd c[10000], d[10000];
    int H, W;
    cin >> H >>W;
    map.resize(H,vector<int>(W));
    REP(y, H) REP(x, W) {
        cin >> map[y][x];
    }
    
    int dx = 1, x = 0, y = 0, x2, y2;
    int cnt = 0;
    while(1) {
        if(x + dx == W || x + dx == -1) {
            dx *= -1;
            x2 = x;
            y2 = y + 1;
        } else {
            x2 = x + dx;
            y2 = y;
        }

        if(y2 >= H) {
            break;
        }

        if(map[y][x] % 2 == 1) {
            a[cnt] = y+1;
            b[cnt] = x+1;
            c[cnt] = y2+1;
            d[cnt] = x2+1;
            map[y][x]--;
            map[y2][x2]++;
            cnt++;
        }

        x = x2;
        y = y2;
    }
    printf("%d\n", cnt);
    REP(i, cnt) {
        printf("%d %d %d %d\n", a[i],b[i],c[i],d[i]);
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:31: error: expected initializer before 'c'
   21 |     int a[10000], b[10000],dd c[10000], d[10000];
      |                               ^
a.cc:48:13: error: 'c' was not declared in this scope
   48 |             c[cnt] = y2+1;
      |             ^
a.cc:49:13: error: 'd' was not declared in this scope
   49 |             d[cnt] = x2+1;
      |             ^
a.cc:60:43: error: 'c' was not declared in this scope
   60 |         printf("%d %d %d %d\n", a[i],b[i],c[i],d[i]);
      |                                           ^
a.cc:60:48: error: 'd' was not declared in this scope
   60 |         printf("%d %d %d %d\n", a[i],b[i],c[i],d[i]);
      |                                                ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<cmath>
 
using namespace std;
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define SWAP(a,b) (a += b,b = a - b,a -= b)
#define ll long long

const int MOD = 1e9 + 7;

int main() {
    int map[500][500];
    int a[10000], b[10000], c[10000], d[10000];
    int H, W;
    cin >> H >>W;
    REP(y, H) REP(x, W) {
        cin >> map[y][x];
    }
    
    int dx = 1, x = 0, y = 0, x2, y2;
    int cnt = 0;
    while(1) {
        if(x + dx == W || x + dx == -1) {
            dx *= -1;
            x2 = x;
            y2 = y + 1;
        } else {
            x2 = x + dx;
            y2 = y;
        }

        if(y2 >= H) {
            break;
        }

        if(map[y][x] % 2 == 1) {
            a[cnt] = y+1;
            b[cnt] = x+1;
            c[cnt] = y2+1;
            d[cnt] = x2+1;
            map[y][x]--;
            map[y2][x2]++;
            cnt++;
        }

        x = x2;
        y = y2;
    }
  　cout<<cnt <<endl;
    REP(i, cnt) {
        cout << a[i]<<b[i]<<c[i]<<d[i])<<endl;
    }
}


Compiler output:
a.cc:57:3: error: extended character 　 is not valid in an identifier
   57 |   　cout<<cnt <<endl;
      |   ^
a.cc: In function 'int main()':
a.cc:57:3: error: '\U00003000cout' was not declared in this scope
   57 |   　cout<<cnt <<endl;
      |   ^~~~~~
a.cc:59:39: error: expected ';' before ')' token
   59 |         cout << a[i]<<b[i]<<c[i]<<d[i])<<endl;
      |                                       ^
      |                                       ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define REP(i, n) for(int i = 0; i < (n); ++i)

#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))

#define endl "\n"
#define pb push_back
#define rtn return
#define elif else if

#define MOD 1000000007
 
const int dx_4[]={1,0,-1,0}, dy_4[]={0,-1,0,1};
const int dx_8[]={1,1,0,-1,-1,-1,0,1}, dy_8[]={0,-1,-1,-1,0,1,1,1};

typedef long long ll;
typedef unsigned long long ull;

template <typename T>
inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <typename T>
inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template <typename T>
inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template <typename T>
inline T nHr(T a,T b){return nCr(a+b-1,b);}
template <typename T>
inline T POW(T a,T b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}

signed main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int h, w, a[500][500];
	vector<int> x, y, xx, yy;
	int n = 0;

	cin >> h >> w;
	REP(i, h){
		REP(j, w) cin >> a[i][j];
	}

	REP(i, h){
		REP(j, w-1){
			if(a[i][j] % 2 == 1){
				a[i][j]--;
				a[i][j+1]++;
				n++;
				x.pb(i+1);	y.pb(j+1);	xx.pb(i+1);	yy.pb(j+2);
			}
		}
	}

	REP(i, h-1){
		if(a[i][j] % 2 == 1){
			a[i][j]--;
			a[i+1][j]++;
			n++;
			x.pb(i+1);	y.pb(j+1);	xx.pb(i+2);	yy.pb(j+1);
		}
	}

	cout << n << endl;
	REP(i, n){
		cout << x[i] << " " << y[i] << " " << xx[i] << " " << yy[i] << endl;
	}
	rtn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:25: error: 'j' was not declared in this scope
   58 |                 if(a[i][j] % 2 == 1){
      |                         ^
Language: C++

#include<bits/stdc++.h>

using namespace std;
struct cell{
int a, b, c, d;
cell(int p, int q, int r, int s){
a = p, b = q, c = r, d = s;
}
};


int main(){
int n, m; cin >> n >> m;
int arr[n+1][m+1];
for(int i = 1; i<=n; ++i) for(int j = 1; j<=m; ++j) cin >> arr[i][j];
vector<cell> res;
for(int i = 1; i<=n; ++i) for(int j = 2; j<=m; ++j) if(arr[i][]j]&1) res.emplace_back(i, j, i, 1), ++arr[i][1];
for(int i = 2; i<=n; ++i) if(arr[i][1]&1) res.emplace_back(i, 1, 1, 1);
cout << res.size() << '\n';
for(auto w: res) cout << w.a << ' ' << w.b << ' ' << w.c << ' ' << w.d << '\n';
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:63: error: expected primary-expression before ']' token
   17 | for(int i = 1; i<=n; ++i) for(int j = 2; j<=m; ++j) if(arr[i][]j]&1) res.emplace_back(i, j, i, 1), ++arr[i][1];
      |                                                               ^
a.cc:17:64: error: expected ')' before 'j'
   17 | for(int i = 1; i<=n; ++i) for(int j = 2; j<=m; ++j) if(arr[i][]j]&1) res.emplace_back(i, j, i, 1), ++arr[i][1];
      |                                                       ~        ^
      |                                                                )
a.cc:17:65: error: expected primary-expression before ']' token
   17 | for(int i = 1; i<=n; ++i) for(int j = 2; j<=m; ++j) if(arr[i][]j]&1) res.emplace_back(i, j, i, 1), ++arr[i][1];
      |                                                                 ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
int n, m; cin >> n >> m;
cout << (n*(m-1)) + n - 1 << '\n';
for(int i = 1; i<=n; ++i) for(int j = 2; j<=m; ++j) cout << i << ' ' << j << ' ' << i << ' ' << 1 << '\n';
for(int i = 2; i<=n; ++i) cout << i << ' ' 1 << ' ' << "1 1\n";
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:43: error: expected ';' before numeric constant
    9 | for(int i = 2; i<=n; ++i) cout << i << ' ' 1 << ' ' << "1 1\n";
      |                                           ^~
      |                                           ;
Language: C++

#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) REP(i,0,n)
using namespace std;

const int LIM1 = 500, LIM2 = 250000;
int h, w, a[LIM1][LIM1];

int main() {
    cin >> h >> w;
    rep(i, h) rep(j, w) cin >> a[i][j];
    bool has = false;
    if (a[0][0] % 2 == 1) {
        has = true;
    }
    int x = 1, y = 0 // current position
    int ox = 0, oy = 0; // odd position
    int ax[LIM2], ay[LIM2], adx[LIM2], ady[LIM2], i = 0; // ans

    while(true) {
        if (x >= w) {
            x = w-1;
            y++;
        } else if (x < 0) {
            x = 0;
            y++;
        }
        if (y >= h) break;

        if (has) {
            ax[i] = ox; ay[i] = oy;
            adx[i] = x; ady[i] = y;
            ox = x; oy = y;
            a[y][x]++; i++;
            if (a[y][x] % 2 == 0) {
                has = false;
            }
        } else if (a[y][x] % 2 == 1) {
            oy = y; ox = x;
            has = true;
        }

        if (y % 2 == 0) x++;
        else x--;
    }

    cout << i << endl;
    rep(j, i) {
        printf("%d %d %d %d\n", ay[j]+1, ax[j]+1, ady[j]+1, adx[j]+1);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: expected ',' or ';' before 'int'
   17 |     int ox = 0, oy = 0; // odd position
      |     ^~~
a.cc:31:21: error: 'ox' was not declared in this scope; did you mean 'ax'?
   31 |             ax[i] = ox; ay[i] = oy;
      |                     ^~
      |                     ax
a.cc:31:33: error: 'oy' was not declared in this scope; did you mean 'ay'?
   31 |             ax[i] = ox; ay[i] = oy;
      |                                 ^~
      |                                 ay
a.cc:39:13: error: 'oy' was not declared in this scope; did you mean 'ay'?
   39 |             oy = y; ox = x;
      |             ^~
      |             ay
a.cc:39:21: error: 'ox' was not declared in this scope; did you mean 'ax'?
   39 |             oy = y; ox = x;
      |                     ^~
      |                     ax
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
    //cout.precision(10);
    int h, w;
    cin >> h >> w;
    int a[600][600];
    for(int i = 1; i <= h; i++){
        for(int j = 1; j <= w; j++){
            cin >> a[i][j];
        }
    }
    vector<int> ans;
    for(int i = 1; i <= h; i++){
        for(int j = 1; j <= w; j++){
            if((i == h) && (j == w)){
                break;
            }
            if(a[i][j] % 2 == 0){
                continue;
            }
            if(j < w){
                a[i][j + 1]++;
                ans.push_back(i);
                ans.push_back(j);
                ans.push_back(i);
                ans.push_back(j + 1);
                continue;
            }
            a[i + 1][j]++;
            ans.push_back(i);
            ans.push_back(j);
            ans.push_back(i + 1);
            ans.push_back(j);
        }
    }
    cout << ans.size() / 4 << endl;
    for(int i = 0; i < ans.size(); i++){
        cout << ans[i];
        if(i % 4 == 3){
            cout << endl;
        } else {
          cout << " ";
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:2: error: expected '}' at end of input
   52 | }
      |  ^
a.cc:9:12: note: to match this '{'
    9 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
using namespace std;
typedef long int li;
typedef long long int lli;
int h, w;
const int INF = 0xfffffff;
int field[505][505] = { 0 };
bool two_ok[505][505];
int sum = 0;
void dense_2(int, int);
void get2(int, int);
void ans_add(int, int, int, int);
vector<int> ansset[4];
int main() {
	
	cin >> h >> w;
	for (int i = 1; i <= h; i++) {
		for (int j = 1; j <= w; j++) {
			cin >> field[i][j];
			sum += field[i][j];
		}
	}
	int two_num = sum / 2;
	int one_num = sum % 2;
	int two_counter = 0;
	for (int i = 0; i < 505; i++) {
		for (int j = 0; j < 505; j++) two_ok[i][j] = false;
	}
	int cnt = 0;
	int nowx = 1, nowy = 1;
	while (two_num > 0) {
		if (field[h][w] == 2) {
			nowx++;
			if (nowx > h) {
				nowx = 1;
				nowy++;
			}
			two_num--;
			continue;
		}
		if (field[nowx][nowy] < 2) {
			int s_x = nowx + 1, s_y = nowy, mov = 0;
			if (s_x > h) {
				s_x = 1;
				s_y++;
			}
			while (field[s_x][s_y] == 0) {
				s_x++;
				if (s_x > h) {
					s_x = 1;
					s_y++;
				}
				mov++;
			}
			int s2 = s_x, s22 = s_y;
			for (int ina = mov; ina > 0; ina--) {
				int ns, ns2=s22;
				ns = s2 - 1;
				if (ns == 0) {
					ns = h;
					ns2--;
				}
				ans_add(s2, s22, ns, ns2);
				s2--;
				if (s2 == 0) {
					s2 = h;
					s22--;
				}
			}
			s_x++;
			if (s_x > h) {
				s_x = 1;
				s_y++;
			}
			mov++;
			while (field[s_x][s_y] == 0) {
				s_x++;
				if (s_x > h) {
					s_x = 1;
					s_y++;
				}
				mov++;
			}
			int s2 = s_x, s22 = s_y;
			for (int ina = mov; ina > 0; ina--) {
				int ns, ns2 = s22;
				ns = s2 - 1;
				if (ns == 0) {
					ns = h;
					ns2--;
				}
				ans_add(s2, s22, ns, ns2);
				s2--;
				if (s2 == 0) {
					s2 = h;
					s22--;
				}
			}
		}
		nowx++;
		if (nowx > h) {
			nowx = 1;
			nowy++;
		}
		if (nowx == h && nowy == w) break;
	}
	int ans_num = ansset[0].size();
	cout << ans_num << endl;
	for (int i = 0; i < ans_num; i++) {
		for (int j = 0; j < 4; j++) cout << ansset[j][i] << " ";
		cout << endl;
	}
}
void ans_add(int a, int b, int c, int d) {
	ansset[0].push_back(a);
	ansset[1].push_back(b);
	ansset[2].push_back(c);
	ansset[3].push_back(d);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:92:29: error: redeclaration of 'int s2'
   92 |                         int s2 = s_x, s22 = s_y;
      |                             ^~
a.cc:63:29: note: 'int s2' previously declared here
   63 |                         int s2 = s_x, s22 = s_y;
      |                             ^~
a.cc:92:39: error: redeclaration of 'int s22'
   92 |                         int s2 = s_x, s22 = s_y;
      |                                       ^~~
a.cc:63:39: note: 'int s22' previously declared here
   63 |                         int s2 = s_x, s22 = s_y;
      |                                       ^~~