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

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <utility>
#include <string>
#include <stack>
#include <regex>
#include <cctype>
#include <numeric>

#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<long long>
#define vvl vector<vector<long long>>

using namespace std;

typedef long long ll;

int main()
{
  int N, X;
  cin >> N >> X;
  vector<int> x(N);
  REP(i, N)
  {
    cin >> x[i];
  }
  if (N == 1) {
    cout << abs(x[0] - X) << endl;
    return 0;
  }
  sort(ALL(v));
  int res = abs(x[0] - x[1]);
  REP(i, N - 1)
  {
    res = __gcd(abs(x[i] - x[i + 1]), res);
  }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:12: error: 'v' was not declared in this scope
   36 |   sort(ALL(v));
      |            ^
a.cc:13:17: note: in definition of macro 'ALL'
   13 | #define ALL(v) (v).begin(), (v).end()
      |                 ^
Language: C

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

int main(){
   int n,x,y,d,i;

   scanf("%d %d",&n,&x);
   for (d=i=0;i<n;i++) {
      scanf("%d",&y);
      if (d==0) c=abs(x-y);
      else {
         j=d;
         k=abs(x-y);
         if (k>j) {
            t=j;j=k;k=t;
         }
         while (k>0) {
            t=j%k;j=k;k=t;
         }
         d=j;
         x=y;
      }
   }
   printf("%d\n",d);
   return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:17: error: 'c' undeclared (first use in this function)
   10 |       if (d==0) c=abs(x-y);
      |                 ^
main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:10: error: 'j' undeclared (first use in this function)
   12 |          j=d;
      |          ^
main.c:13:10: error: 'k' undeclared (first use in this function)
   13 |          k=abs(x-y);
      |          ^
main.c:15:13: error: 't' undeclared (first use in this function)
   15 |             t=j;j=k;k=t;
      |             ^
Language: C++

nclude<bits/stdc++.h>
using namespace std;
int a[1000010];
int main()
{
	int n,x;
	cin>>n>>a[1];
	for(int i=2;i<=n+1;i++)
		cin>>a[i];
	n++;
	sort(a+1,a+n+1);
	int res=a[2]-a[1];
	for(int i=3;i<=n;i++)
		res=__gcd(res,a[i]-a[i-1]);
	cout<<res<<endl;
	return 0;
}

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude<bits/stdc++.h>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin>>n>>a[1];
      |         ^~~
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |         sort(a+1,a+n+1);
      |         ^~~~
      |         short
a.cc:14:21: error: '__gcd' was not declared in this scope
   14 |                 res=__gcd(res,a[i]-a[i-1]);
      |                     ^~~~~
a.cc:15:9: error: 'cout' was not declared in this scope
   15 |         cout<<res<<endl;
      |         ^~~~
a.cc:15:20: error: 'endl' was not declared in this scope
   15 |         cout<<res<<endl;
      |                    ^~~~
Language: C++

#include <iostream>
#include <vector>

#define ll long long int

using namespace std;


ll getGCD(ll n1, ll n2) {
  while(n1 != n2) {
    cout << n1 << ' ' << n2 << endl;
    if(n1 > n2)
      n1 -= n2;
    else
      n2 -= n1;
    if (n2 == 0 || n1 == 0) return 1;
  }
  return n1;
}

int main() {
  int n;
  ll p;
  
  cin >> n >> p;
  vector<ll> x(n);

  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  sort(x.begin(), x.end());
  int gcd = n > 1 ? (x[1] - x[0]) : abs(x[0] - p);
  for (int i = 2; i < n; i++) {
    gcd = getGCD(gcd, x[i] - x[i - 1]);
  }
  if (x[0] > p) {
    gcd = getGCD(gcd, x[0] - p);
  }
  else {
    for (int i = 1; i < n; i++) {
      if (x[i] > p) {
	gcd = max(getGCD(gcd, x[i] - p), getGCD(gcd, p - x[i - 1]));
	break;
      }
    }
  }
  cout << gcd;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   31 |   sort(x.begin(), x.end());
      |   ^~~~
      |   short
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int a[10005];
int main()
{
	int n,x;
	scanf("%d %d",&n,&x);
	int m;
	for(int i=0;i<n;i++)
	{
		scanf("%d",&m);
		a[i]=fabs(m-x);
	}
	sort(a,a+n);
	for(int i=0;i<n;i++)
	{
		for(int j=n-1;j>=0;j--)
			if(a[j]%a[i]!=0)
				{
					cout<<a[i-1]<<endl;
					return 0;
				}
	}
	cout<<a[n-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   15 |         sort(a,a+n);
      |         ^~~~
      |         sqrt
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int a[10005];
int main()
{
	int n,x;
	scanf("%d %d",&n,&x);
	int m;
	for(int i=0;i<n;i++)
	{
		scanf("%d",&m);
		a[i]=abs(m-x);
	}
	sort(a,a+n);
	for(int i=0;i<n;i++)
	{
		for(int j=n-1;j>=0;j--)
			if(a[j]%a[i]!=0)
				{
					cout<<a[i-1]<<endl;
					return 0;
				}
	}
	cout<<a[n-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   15 |         sort(a,a+n);
      |         ^~~~
      |         sqrt
Language: C++

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

int main(){
    int N,X;
    cin>>N>>X;
    vector<int> zahyo(N);
    long ans=0;
    long min=999999999999;

    for(auto &&x:zahyo){
        cin>>x;    
    }

    int hazama=0;
    bool check=true;




    for(int i=1;i<N&&check;i++){
        if(zahyo[i-1]<X&&zahyo[i]>X){
            hazama=i;
        }
    }

    if(X<zahyo[0]){
        ans=abs(zahyo[0]-X);
    }else{
        ans=min(abs(zahyo[i]-X),abs(zahyo[i-1]-X));
    }



cout<<ans<<endl;





}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:27: error: 'i' was not declared in this scope
   30 |         ans=min(abs(zahyo[i]-X),abs(zahyo[i-1]-X));
      |                           ^
a.cc:30:50: error: 'min' cannot be used as a function
   30 |         ans=min(abs(zahyo[i]-X),abs(zahyo[i-1]-X));
      |                                                  ^
Language: C++

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

int main(){
    int N,X;
    cin>>N>>X;
    vector<int> zahyo(N);
    long ans=0;
    long min=999999999999;

    for(auto &&x:zahyo){
        cin>>x;    
    }

    int hazama=0;
    bool check=true;




    for(int i=1;i<N&&check;i++){
        if(zahyo[i-1]<X&&zahyo[i]>X){
            hazama=i;
        }
    }

    if(X<zahyo[0]){
        ans=abs(zahyo[0]-X);
    }else{
        ans=min(abs(zahyo[i]-X),abs(zahyo[i-1]-X))
    }



cout<<ans<<endl;





}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:27: error: 'i' was not declared in this scope
   30 |         ans=min(abs(zahyo[i]-X),abs(zahyo[i-1]-X))
      |                           ^
a.cc:30:50: error: 'min' cannot be used as a function
   30 |         ans=min(abs(zahyo[i]-X),abs(zahyo[i-1]-X))
      |                                                  ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

typedef long long uint;

uint euclid(uint a, uint b)
{
  while(1){
    if(a < b){
      uint temp;
      temp = a;
      a = b;
      b = temp;
    }
    if(!b) break;
    a %= b;
  }
  return a;
}

int main(void)
{
  uint N, X;
  cin >> N >> X;
  vector<uint> vi(N+1);
  for(int i = 0; i < N; i++){
    cin >> vi[i];
  }
  vi[N] = X;
  sort(vi.begin(), vi.end());
  uint a = vi[1] - vi[0];
  uint b;
  uint c;
  for(int i = 1; i < N; i++){

    b = vi[i+1] - vi[i];
    a = euclid(a, b);
  }
  cout << a << endl;
  return 0;
}


Compiler output:
a.cc:7:19: error: conflicting declaration 'typedef long long int uint'
    7 | typedef long long uint;
      |                   ^~~~
In file included from /usr/include/stdlib.h:514,
                 from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/sys/types.h:150:22: note: previous declaration as 'typedef unsigned int uint'
  150 | typedef unsigned int uint;
      |                      ^~~~
Language: C++

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    int n, x;
    cin >> n >> x;
    int y[n];
    int c = 1000000000;
    for (int i = 0; i < n; i++) {
        cin >> y[i];
        y[i] = y[i] - x;
        if (abs(y[i]) < c) {
            c = y[i];
        }
    }   
    bool flag = true;
    while (flag) {
        flag = false;
        for (int i = 0; i < n; i++) {
            if (y[i] % c != 0) {

                //c = gcd(c, y[i]);
                int a, b, r, tmp;
                b = c;
                a = y[i];
                /*

                /* 自然数 a > b を確認・入替 */
                if (a < b) {
                    tmp = a;
                    a = b;
                    b = tmp;
                }
                * /

                    /* ユークリッドの互除法 */
                    r 
                    = a % b;
                while (r != 0) {
                    a = b;
                    b = r;
                    r = a % b;
                } 
                c = b;

    
                flag = true;
            }
        }
    }
    cout << c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:19: error: expected primary-expression before '/' token
   35 |                 * /
      |                   ^
Language: Java

import java.util.*;

public class Main {

    int INF = Integer.MAX_VALUE;

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int X = sc.nextInt();
        int[] x = new int[N];
        int a = 0;
        int b = 0;
        for (int i = 0; i < N; i++) {
            x[i] = sc.nextInt();
            if (i > 0 && x[i - 1] < X && x[i] > X) {
                a = X - x[i - 1];
                b = x[i] - X;
            }
        }
        if (N == 1 || x[0] > X) {
            System.out.println(Math.abs(x[0] - X));
            return;
        }
        if (x[N - 1] < X) {
            System.out.println(Math.abs(x[N - 1] - X));
            return;
        }
        System.out.println(a < b ? a : b);

    }

    int gcd(int m, int n) {
        if (m < n) {
            return gcd(n, m);
        }
        if (m == 0) {
            return m;
        }
        return gcd(n, m % n);
    }

Compiler output:
Main.java:45: error: reached end of file while parsing
    }
     ^
1 error
Language: Java

package codes;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;
import java.io.PrintWriter;

public class ABC109C {
    public void solve(int testNumber, Scanner in, PrintWriter out) {
        int N = in.nextInt();
        int X = in.nextInt();
        long[] arr = new long[N+1];
        for (int i = 0; i < N; i++) {
            arr[i] = in.nextLong();
        }
        arr[N] = X;
        Arrays.sort(arr);
        long ans = 0;
        for (int i = 0; i < N; i++) {
            long a = arr[i];
            long b = arr[i+1];
            if (i == 0) {
                ans = b-a;
            } else {
                ans = gcd(ans, b-a);
            }
        }
        out.println(ans);
    }

    public static long gcd(long m, long n) {
        return BigInteger.valueOf(m).gcd(BigInteger.valueOf(n)).longValue();
    }
}


Compiler output:
Main.java:8: error: class ABC109C is public, should be declared in a file named ABC109C.java
public class ABC109C {
       ^
1 error
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;


int main() {
	long long int N, X;
	cin >> N >> X;
	vector<long long int> x(N);
	for (int i = 0; i < N; i++) {
		cin >> x[i];
	}

	long long int minD = INT_MAX;
	for (int i = 0; i < N; i++) {
		minD = min(minD, abs(X - x[i]));
	}
	cout << minD << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: 'INT_MAX' was not declared in this scope
   18 |         long long int minD = INT_MAX;
      |                              ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <algorithm>
  +++ |+#include <climits>
    7 | using namespace std;
Language: Java

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.math.BigInteger;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Kenji
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC109C solver = new ABC109C();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC109C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int X = in.nextInt();
            long[] arr = new long[N + 1];
            for (int i = 0; i < N; i++) {
                arr[i] = in.nextLong();
            }
            arr[N] = X;
            Arrays.sort(arr);
            long ans = 0;
            for (int i = 0; i < N; i++) {
                long a = arr[i];
                long b = arr[i + 1];
                if (i == 0) {
                    ans = b - a;
                } else {
                    ans = gcd(ans, b - a);
                }
            }
            out.println(ans);
        }

        public static long gcd(long m, long n) {
            return BigInteger.java.math.BigInteger.valueOf(m).gcd(BigInteger.java.math.BigInteger.valueOf(n)).longValue();
        }

    }
}



Compiler output:
Main.java:50: error: cannot find symbol
            return BigInteger.java.math.BigInteger.valueOf(m).gcd(BigInteger.java.math.BigInteger.valueOf(n)).longValue();
                             ^
  symbol:   variable java
  location: class BigInteger
Main.java:50: error: cannot find symbol
            return BigInteger.java.math.BigInteger.valueOf(m).gcd(BigInteger.java.math.BigInteger.valueOf(n)).longValue();
                                                                            ^
  symbol:   variable java
  location: class BigInteger
2 errors
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>

long long x[105050];

inline long long _abs(long long a)
{
	return(a<0?-a:a);
}

inline long long gcd(long long a,long long b)
{
	if(a<b)
	{
		a+=b;
		b=a-b;
		a=a-b;
	}
	long long r=a%b;
	while(r)
	{
		a=b;
		b=r;
		r=a%b;
	}
	return b;
}

long long main()
{
	long long N,X;scanf("%lld%lld",&N,&X);
	for(register long long i=1;i<=N;i++)
		scanf("%lld",&x[i]),x[i]-=X;
	long long ans=x[1];
	for(register long long i=2;i<=N;i++)
		ans=gcd(_abs(ans),_abs(x[i]));
	prlong longf("%lld\n",ans);
	return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:33:32: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   33 |         for(register long long i=1;i<=N;i++)
      |                                ^
a.cc:36:32: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   36 |         for(register long long i=2;i<=N;i++)
      |                                ^
a.cc:38:9: error: 'prlong' was not declared in this scope; did you mean 'ulong'?
   38 |         prlong longf("%lld\n",ans);
      |         ^~~~~~
      |         ulong
Language: C++

int gcd(int x, int y) {
  if (x == 1 || y == 1) return 1;
  if (x % y == 0) return abs(y);
  else return gcd(y, x % y);
}

int main(){
  int n, x; cin >> n >> x;
  vector<int> v(n+1); v[n] = x;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  int ans = v[1] - v[0];
  for (int i = 1; i < n; i++) {
    ans = gcd(ans, v[i+1] - v[i]);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:3:26: error: 'abs' was not declared in this scope
    3 |   if (x % y == 0) return abs(y);
      |                          ^~~
a.cc: In function 'int main()':
a.cc:8:13: error: 'cin' was not declared in this scope
    8 |   int n, x; cin >> n >> x;
      |             ^~~
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> v(n+1); v[n] = x;
      |   ^~~~~~
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> v(n+1); v[n] = x;
      |          ^~~
a.cc:9:23: error: 'v' was not declared in this scope
    9 |   vector<int> v(n+1); v[n] = x;
      |                       ^
a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |   sort(v.begin(), v.end());
      |   ^~~~
      |   short
a.cc:18:3: error: 'cout' was not declared in this scope
   18 |   cout << ans << endl;
      |   ^~~~
a.cc:18:18: error: 'endl' was not declared in this scope
   18 |   cout << ans << endl;
      |                  ^~~~
Language: C++

    #include<bits/stdc++.h>
     
    using namespace std;
      vector<int> iti,sa;
int gcd(int a,int b){
	if(a<b)return gcd(b,a);
  if(b==0) return a;
  if(a%b==0)return b;
  return gcd(b,a%b);
}
int main(){
    int n,x;
cin>>n>>x;
        iti.pb(x);
        for(int i=0;i<n;i++){
        int y;
          cin>>y;
          iti.push_back(y);
        }
        sort(iti.begin(),iti.end());
        for(int i=0;i<n;i++)sa.push_back(iti[i+1]-iti[i]);
        int g=sa[0];
        for(int i=1;i<n;i++){
        g=gcd(g,sa[i]);
        }
        cout<<g<<endl;
      return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'class std::vector<int>' has no member named 'pb'
   14 |         iti.pb(x);
      |             ^~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <numeric>

using namespace std;

int GCD(int a, int b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}

int main() {
  int n, x;
  cin >> n >> x;
  
  vector<int> v;
  while (n--) {
    int a;
    cin >> a;
    v.push_back(abs(a - x));
  }
  
  int g = 0;
  for (int a : v) {
    g = GCD(gcd, a);
  }
  cout << g << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:12: error: cannot resolve overloaded function 'gcd' based on conversion to type 'int'
   28 |     g = GCD(gcd, a);
      |         ~~~^~~~~~~~
Language: C++

/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <list>
#include <stack>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std; 

inline void solve(){ 
    int  r, c ; 
    cin >> r >> c ; 
    vector <vector <int> > g(r+5,vector <int> (c+5)); 
    for (int i=1;i<=r;i++) { 
    	for (int j=1;j<=c;j++) { 
    		cin >> g[i][j] ; 
    		g[i][j] = ( (g[i][j] & 1)? 1 : 0 ) ; 
    		if (g[i][j]&1) odd++,row[i]=true,col[j]=true;
    	} 
    } 
    vector <pair<pii,pii>> res; 
    pair <pii,pii> p;
    for (int i=1;i<=r;i++){
    	for (int j=1;j<c;j++){
    		if (g[i][j]&1) {
    			g[i][j+1]++;
    			p.ff.ff=i; p.ff.ss=j;
    			p.ss.ff=i; p.ss.ss=j+1;
    			res.pb(p);
    		}
    	}
    }
    for (int i=1;i<r;i++){
    	if (g[i][c]&1){
    		g[i+1][c]++;
    		p.ff.ff=i; p.ff.ss=c;
    		p.ss.ff=i+1; p.ss.ss=c;
    		res.pb(p);
    	}
    }
    cout << sz(res) << endl;
    for (auto &it: res) {
    	printf("%lld %lld %lld %lld\n",it.ff.ff,it.ff.ss,it.ss.ff,it.ss.ss);
    }
} 

signed main()
{
    int n=1; // cin>>n;
    while (n--) solve();
    return 0;
}
/*
2 3
1 2 3
0 1 1


3 2
1 0
2 1
1 0

1 5
9 9 9 9 9

*/

Compiler output:
a.cc: In function 'void solve()':
a.cc:39:32: error: 'odd' was not declared in this scope
   39 |                 if (g[i][j]&1) odd++,row[i]=true,col[j]=true;
      |                                ^~~
a.cc:39:38: error: 'row' was not declared in this scope; did you mean 'pow'?
   39 |                 if (g[i][j]&1) odd++,row[i]=true,col[j]=true;
      |                                      ^~~
      |                                      pow
a.cc:39:50: error: 'col' was not declared in this scope; did you mean 'cosl'?
   39 |                 if (g[i][j]&1) odd++,row[i]=true,col[j]=true;
      |                                                  ^~~
      |                                                  cosl
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pint;
typedef pair<pint,pint> ppint;
const ll INF = 100000000;
#define rep1(i, n) for (ll i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)
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() {
    ll h, w;
    cin >> h >> w;
    vector<vector<ll> > a(h, vector<ll>(w, 0));
    ll odd = 0;
    rep1(i, h) rep1(j, w) {
            cin >> a[i][j];
            if (a[i][j] & 1) odd++;
    }
    vector<PP> res;
    ll num = 0;
    ll x = 0, y = 0;
    rep1(i, w*h){
        if (a[x][y] & 1) num++;

        ll nx = x, ny = y;
        if (x % 2 == 0) {
            if (ny == w-1) nx++;
            else ny++;
        }
        else {
            if (ny == 0) nx++;
            else ny--;
        }
        if (num & 1) if (num < odd) res.push_back(ppint(pint(x, y), pint(nx, ny)));
        x = nx, y = ny;
    }
    
    cout << res.size() << endl;
    for (auto p: res) {
        cout << p.first.first+1 << " " << p.first.second+1 << " " << p.second.first+1 << " " << p.second.second+1 << " " << endl;
    }
    //printf("%.12f", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:12: error: 'PP' was not declared in this scope
   22 |     vector<PP> res;
      |            ^~
a.cc:22:14: error: template argument 1 is invalid
   22 |     vector<PP> res;
      |              ^
a.cc:22:14: error: template argument 2 is invalid
a.cc:37:41: error: request for member 'push_back' in 'res', which is of non-class type 'int'
   37 |         if (num & 1) if (num < odd) res.push_back(ppint(pint(x, y), pint(nx, ny)));
      |                                         ^~~~~~~~~
a.cc:41:17: error: request for member 'size' in 'res', which is of non-class type 'int'
   41 |     cout << res.size() << endl;
      |                 ^~~~
a.cc:42:18: error: 'begin' was not declared in this scope
   42 |     for (auto p: res) {
      |                  ^~~
a.cc:42:18: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:42:18: error: 'end' was not declared in this scope
   42 |     for (auto p: res) {
      |                  ^~~
a.cc:42:18: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
Language: C++

int H, W, A[505][505];
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> H >> W;
    rep(y, 0, H) rep(x, 0, W) cin >> A[y][x];
 
    vector<tuple<int, int, int, int>> ans;
    rep(y, 0, H) rep(x, 0, W - 1) {
        if (A[y][x] % 2 == 1) {
            A[y][x]--;
            A[y][x + 1]++;
            ans.push_back(make_tuple(y, x, y, x + 1));
        }
    }
    rep(y, 0, H - 1) {
        if (A[y][W-1] % 2 == 1) {
            A[y][W - 1]--;
            A[y + 1][W - 1]++;
            ans.push_back(make_tuple(y, W - 1, y + 1, W - 1));
        }
    }
 
    int n = ans.size();
    printf("%d\n", n);
    fore(t, ans) {
        int a, b, c, d;
        tie(a, b, c, d) = t;
        printf("%d %d %d %d\n", a + 1, b + 1, c + 1, d + 1);
    }
}

Compiler output:
a.cc: In function 'void _main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> H >> W;
      |     ^~~
a.cc:5:9: error: 'y' was not declared in this scope
    5 |     rep(y, 0, H) rep(x, 0, W) cin >> A[y][x];
      |         ^
a.cc:5:5: error: 'rep' was not declared in this scope
    5 |     rep(y, 0, H) rep(x, 0, W) cin >> A[y][x];
      |     ^~~
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<tuple<int, int, int, int>> ans;
      |     ^~~~~~
a.cc:7:12: error: 'tuple' was not declared in this scope
    7 |     vector<tuple<int, int, int, int>> ans;
      |            ^~~~~
a.cc:7:18: error: expected primary-expression before 'int'
    7 |     vector<tuple<int, int, int, int>> ans;
      |                  ^~~
a.cc:23:13: error: 'ans' was not declared in this scope
   23 |     int n = ans.size();
      |             ^~~
a.cc:24:5: error: 'printf' was not declared in this scope
   24 |     printf("%d\n", n);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int H, W, A[505][505];
a.cc:25:10: error: 't' was not declared in this scope
   25 |     fore(t, ans) {
      |          ^
a.cc:25:5: error: 'fore' was not declared in this scope
   25 |     fore(t, ans) {
      |     ^~~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
#include <bitset>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
#define vec_unique(_a) _a.erase(std::unique(all(_a)), _a.end());
#define vvec vector<vector<ll>>
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
const int mod = 1000000007;
ll power(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x *= x; p /= 2; } else { a *= x; p--; } }return a; }
ll mpower(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x = x * x % mod; p /= 2; } else { a = a * x % mod; p--; } }return a; }
ll c(ll n, ll k) { ll a = 1; rep(i, 1, k) { a *= n - i + 1; a /= i; }return a; }
ll mc(ll n, ll m) { ll k = 1, l = 1; rep(i, n - m + 1, n + 1) k = k * i % mod; rep(i, 1, m + 1) l = l * i % mod; l = mpower(l, mod - 2); return k * l % mod; }
chat buf[100000];
int main() {
	int H, W, c = 0;
	cin >> H >> W;
	vector<vector<int>> a(H, vector<int>(W));
	rep(i, 0, H)rep(i2, 0, W) {
		cin >> a[i][i2];
		if (a[i][i2] % 2)c++;
	}
	int tx, ty, cc = 0;
	bool f = 0, t = false;
	rep(i, 0, H) {
		rep(i2, 0, W) {
			if(t)sprintf(buf,"%d %d %d %d\n", ty + 1, tx + 1, i + 1, (f ? W - i2 - 1 : i2) + 1);
			if (a[i][f ? W - i2 - 1 : i2] % 2) {
				if (t) {
					t = false;
					cc++;
				}
				else {
					t = true;
					tx = f ? W - i2 - 1 : i2;
					ty = i;
				}
			}
		}
		f = !f;
	}
	printf("%d\n", cc);
	printf(buf);
	return 0;
}

Compiler output:
a.cc:33:1: error: 'chat' does not name a type; did you mean 'char'?
   33 | chat buf[100000];
      | ^~~~
      | char
a.cc: In function 'int main()':
a.cc:46:38: error: 'buf' was not declared in this scope
   46 |                         if(t)sprintf(buf,"%d %d %d %d\n", ty + 1, tx + 1, i + 1, (f ? W - i2 - 1 : i2) + 1);
      |                                      ^~~
a.cc:62:16: error: 'buf' was not declared in this scope
   62 |         printf(buf);
      |                ^~~
Language: C++

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

using ll = long long;
using vi = vector<int>;
using vll = vector<long long>;

int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};

constexpr long long mod = 1000000007;

#define rep(i, n) for (int i = 0; i < n; i++)

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

    int h, w;
    cin >> h >> w;

    vector<vi> a(h, vi(w, 0));
    rep(i, h) rep(j, w) cin >> a[i][j];

    vector<vector<bool>> b(h, vector<bool>(w, false));

    vector<vector<int>> v(h * w, vector<int>(4, -1));

    int cnt = 0;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            b[i][j] = true;

            if (a[i][j] % 2 != 0) {
                for (int k = 0; k < 4; k++) {
                    int x = j + dx[k];
                    int y = i + dy[k];

                    if (x < 0 || x >= w)
                        continue;

                    if (y < 0 || y >= h)
                        continue;

                    if (!b[y][x] && a[y][x] % 2 == 0) {
                        v[cnt][0] = i + 1;
                        v[cnt][1] = j + 1;
                        v[cnt][2] = y + 1;
                        v[cnt][3] = x + 1;
                        cnt++;
                        a[y][x]++;
                        a[i][j]--;

                        break;
                    }

                    if (b[y][x] && a[y][x] % 2 == 1) {
                        v[cnt][0] = i + 1;
                        v[cnt][1] = j + 1;
                        v[cnt][2] = y + 1;
                        v[cnt][3] = x + 1;
                        cnt++;

                        a[y][x]++;
                        a[i][j]--;

                        break;
                    }
                }
            }
        }
    }

    cout << cnt << endl;
    rep(i, cnt) {
        cout << v[i][0] << " " < < < < v[i][1] << " " << v[i][2] << " " << v[i][3] << endl;
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:34: error: expected primary-expression before '<' token
   76 |         cout << v[i][0] << " " < < < < v[i][1] << " " << v[i][2] << " " << v[i][3] << endl;
      |                                  ^
a.cc:76:36: error: expected primary-expression before '<' token
   76 |         cout << v[i][0] << " " < < < < v[i][1] << " " << v[i][2] << " " << v[i][3] << endl;
      |                                    ^
a.cc:76:38: error: expected primary-expression before '<' token
   76 |         cout << v[i][0] << " " < < < < v[i][1] << " " << v[i][2] << " " << v[i][3] << endl;
      |                                      ^
a.cc:76:48: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'const char [2]' to binary 'operator<<'
   76 |         cout << v[i][0] << " " < < < < v[i][1] << " " << v[i][2] << " " << v[i][3] << endl;
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define maxs(a, b) a = max(a, b)
#define mins(a, b) a = min(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll linf = (ll)4e18;
const int inf = 1001001001;
const int mod = 1000000007;

int mp[505][505];

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int h, w;
	cin >> h >> w;
	rep(i, h)rep(j, w) cin >> mp[i][j];
	vector<tuple<int, int, int, int>> ans;
	rep(i, h) {
		if(i % 2 == 0) rep(j, w) {
			if (mp[i][j] % 2 == 0) continue;
			mp[i][j]--;
			if (j + 1 < w) {
				mp[i][j + 1]++;
				ans.emplace_back(i + 1, j + 1, i + 1, j + 2);
			}
			else if (i + 1 < h) {
				mp[i + 1][j]++;
				ans.emplace_back(i + 1, j + 1, i + 2, j + 1);
			}
		}
		else {
			for (int j = w - 1; j >= 0; --j) {
				if (mp[i][j] % 2 == 0) continue;
				mp[i][j]--;
				if (j - 1 >= 0) {
					mp[i][j - 1]++;
					ans.emplace_back(i + 1, j + 1, i + 1, j);
				}
				else if (i + 1 < h) {
					mp[i + 1][j]++;
					ans.emplace_back(i + 1, j + 1, i + 2, j + 1);
				}
			}
		}
	}
	cout << ans.size() << endl;
	rep(i, ans.size()) {
		printf_s("%d %d %d %d\n", get<0>(ans[i]), get<1>(ans[i]), get<2>(ans[i]), get<3>(ans[i]));
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:17: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
   54 |                 printf_s("%d %d %d %d\n", get<0>(ans[i]), get<1>(ans[i]), get<2>(ans[i]), get<3>(ans[i]));
      |                 ^~~~~~~~
      |                 printf
Language: C++

#include <iostream>
#include <vector>
using namespace std;

struct point{
  int i,j,k,l;
};

int main(){
  int h,w;
  cin >> h >> w;
  int m[h][w];
  vector<point> ret;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin >> m[i][j];
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w-1;j++){
      if(m[i][j]%2==1){
        m[i][j]--;
        m[i][j+1]++;
        ret.push_back({i+1,j+1,i+1,j+2});
      }
    }
  }
  for(i=0;i<h-1;i++){
    if(m[i][w-1]%2==1){
      m[i+1][w-1]++;
      ret.push_back({i+1,w,i+2,w});
    }
  }
  cout << (int)ret.size() << endl;
  for(auto &x:ret){
    printf("%d %d %d %d\n",x.i,x.j,x.k,x.l);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:7: error: 'i' was not declared in this scope
   28 |   for(i=0;i<h-1;i++){
      |       ^
a.cc:31:20: error: no matching function for call to 'std::vector<point>::push_back(<brace-enclosed initializer list>)'
   31 |       ret.push_back({i+1,w,i+2,w});
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~
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 = point; _Alloc = std::allocator<point>; value_type = point]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<point>::value_type&' {aka 'const point&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = point; _Alloc = std::allocator<point>; value_type = point]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<point>::value_type&&' {aka 'point&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
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];
        }
    }

    bool move = false;
    vector<int> xs;
    vector<int> ys;
    vector<int> xe;
    vector<int> ye;

    for (int i = 0; i < h; i++)
    {
        if(i % 2 == 0)
        {
            for (int j = 0; j < h; j++)
            {
                if(move)
                {
                    xe.push_back(j);
                    ye.push_back(i);
                    a[i][j] += move;
                }
                if(a[i][j] % 2 == 1)
                {
                    xs.push_back(j);
                    ys.push_back(i);
                    move = true;
                }
                else
                {
                    move = false;
                }
            }
        }
        else
        {
            for (int j = h - 1; j >= 0; j--)
            {
                if(move)
                {
                    xe.push_back(j);
                    ye.push_back(i);
                }
                a[i][j] += move;
                if(a[i][j] % 2 == 1)
                {
                    xs.push_back(j);
                    ys.push_back(i);
                    move = true;
                }
                else
                {
                    move = false;
                }
            }
        }
    }

    //cout << ys.size() << " " << xs.size() << " " << ye.size() << " " << xe.size() << " " << endl;

    cout << ys.size() << endl;
    for (int i = 0; i < ys.size(); i++)
    {
        cout << ys.[i] << " " << xs[i] << " " << ye[i] << " " << xe[i] << endl;
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:76:20: error: expected unqualified-id before '[' token
   76 |         cout << ys.[i] << " " << xs[i] << " " << ye[i] << " " << xe[i] << endl;
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=5e18;

int main() {
  ll h,w;
  cin >> h >> w;
  mat a(h,vec(w));
  ll tmp=0;
  for(ll i=0;i<h;i++) {
    for(ll j=0;j<w;j++) {
      cin >> a[i][j];
    }
  }
  vec sx,sy,gx,gy;
  for(ll i=0;i<h;i++) {
    for(ll j=0;j<w;j++) {
      if(j==w-1&&i=h-1) continue;
      ll tmp;
      tmp=a[i][j]%2;
      a[i][j]-=tmp;
      if(tmp) {
        sx.push_back(j+1);
        sy.push_back(i+1);
        if(j=w-1) {
          a[i+1][j]+=tmp;
          gx.push_back(j+1);
          gy.push_back(j+2);
        }
        else {
          a[i][j+1]+=tmp;
          gx.push_back(j+2);
          gy.push_back(j+1);
        }
      }
    }
  }
  cout << sy.size() << endl;
  for(ll i=0;i<sy.size();i++) {
    cout << sx[i] << " " << sy[i] << " " << gx[i] << " " << gy[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:16: error: lvalue required as left operand of assignment
   24 |       if(j==w-1&&i=h-1) continue;
      |          ~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<(n);i++)
#define rep2(i,a,n) for(int i=a;i<n;i++)
#define been(ix) (ix).begin(),(ix).end()
using namespace std;
typedef long long ll; 
typedef vector<int> vi;
typedef vector<long long> vl;
const ll INFL = 1e18;
const int INF = 1001001001; 
typedef pair<int,int> P;
#define foreach(ix,i) for(auto& (ix) : (i))
typedef long double ld;
const int mod =1000000007;
int main(){
    int h,w;
    cin>>h>>w;
    int g[h][w];
    rep(i,h)rep(j,w)cin>>g[i][j];
    int n =0;
    vector<int>ans[250001];
    rep(i,h){
        rep(j,w){
            if(g[i][j]%2!=0){
                if(j==w-1&&i==h-1)continue;
                ans[n].push_back(i+1);
                ans[n].push_back(j+1);
                if(j==w-1&&i!=h-1){
                    ans[n].push_back(i+2);
                    ans[n].push_back(j+1);
                    g[i][j]--;
                    g[i+1][j]++;
                }
                else {
                    ans[n].push_back(i+1);
                    ans[n].push_back(j+2);
                    g[i][j]--;
                    g[i][j+1]++;
                }
                n++;
            }
        }
    }
    cout<<n<<endl;
    rep(i,n){
        if(j!=3)cout<<ans[i][j]<<" ";
            else
            {
                cout<<ans[i][j];
            }
        cout<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:12: error: 'j' was not declared in this scope
   46 |         if(j!=3)cout<<ans[i][j]<<" ";
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,s,n) for(int i=s;i<n;i++)
#define fi first
#define se second
#define all(c) c.begin(),c.end()
typedef long long int ll;
typedef pair<int, int> P;
typedef long double ld;
void Ans(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}

const ll INF=1001001001;
const ll mod=1000000007;

int main(){
  int h,w;cin>>h>>w;
  int a[h][w];
  rep(i,h)rep(j,w) cin>>a[i][j];
  int n=0;
  vector<int> dx,dy;
  dx={1,0,-1,0};
  dy={0,1,0,-1};
  vector<int> v[h+w];
  rep(i,h){
    if(i%2==0){
    rep(j,w){
      if(a[i][j]%2==0) continue;
      rep(u,4){
        if(i+dx[u]>=0&&i+dx[u]<h&&j+dy[u]>=0&&j+dy[u]<w){
          if(a[i+dx[u]][j+dy[u]]%2!=0){
            a[i+dx[u]][j+dy[u]]++;
            a[i][j]--;
            v[n]={i+1,j+1,i+dx[u]+1,j+dy[u]+1};
            n++;
            break;
          }
        }
      }
      if(a[i][j]%2==0) continue;
      a[i][j]--;
      if(j+1<w) {
        a[i][j+1]++;
        v[n]={i+1,j+1,i+1,j};
        n++;
      }
      else if(i==h){
        continue;
      }
      else{
        a[i+1][j]++;
        v[n]={i+1,j+1,i+2,j+1}
        n++;
      }
    }
    }
    else{
      rep(o,w){
        int j=w-1-o;
      if(a[i][j]%2==0) continue;
      rep(u,4){
        if(i+dx[u]>=0&&i+dx[u]<h&&j+dy[u]>=0&&j+dy[u]<w){
          if(a[i+dx[u]][j+dy[u]]%2!=0){
            a[i+dx[u]][j+dy[u]]++;
            a[i][j]--;
            v[n]={i+1,j+1,i+dx[u]+1,j+dy[u]+1};
            n++;
            break;
          }
        }
      }
      if(a[i][j]%2==0) continue;
      a[i][j]--;
      if(j-1>=0) {
        a[i][j-1]++;
        v[n]={i+1,j+1,i+1,j,};
          n++;
      }
      else if(i==h){
        continue;
      }
      else{
        a[i+1][j]++;
        v[n]={i+1,j+1,i+2,j+1};
        n++;
      }
    }
  }
  
  cout<<n<<endl;
  rep(i,n){
    cout<<v[i][0]<<' '<<v[i][1]<<' '<<v[i][2]<<' '<<v[i][3]<<endl;
  }
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:52:31: error: expected ';' before 'n'
   52 |         v[n]={i+1,j+1,i+2,j+1}
      |                               ^
      |                               ;
   53 |         n++;
      |         ~                      
a.cc:94:2: error: expected '}' at end of input
   94 | }
      |  ^
a.cc:16:11: note: to match this '{'
   16 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f),(t)-(f)))
#define ALL(a) (a).begin(),(a).end()
using namespace std;
ll h,w;
ll ho[1111][1111];
struct co{
  ll y,x,y1,x2;
};
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>h>>w;
  vector<co>ans;
  for(int i=0;i<h;i++)for(int j=0;j<w;j++)cin>>ho[i][j];
  for(int i=0;i<h;i++){
    if(i%2 == 0){
      for(int j=0;j<w;j++){
	if(j!=w-1){
	  if(ho[i][j]%2){ho[i][j+1]++;ho[i][j]--;ans.pb({i,j,i,j+1});}
	}else{
	  if(ho[i][j]%2){ho[i+1][j]++;ho[i][j]--;ans.pb({i,j,i+1,j});}
	}
      }
    }else{
      for(int j=w-1;j>=0;j--){
	if(j!=0){
	  if(ho[i][j]%2){ho[i][j-1]++;ho[i][j]--;ans.pb({i,j,i,j-1});}
	}else{
	  if(ho[i][j]%2){ho[i+1][j]++;ho[i][j]--;ans.pb({i,j,i+1,j});}
	}
      }
      }
    }
  }
  cout<<ans.size()<<endl;
  for(auto a:ans){
    cout<<a.y<<" "<<a.x<<" "<<a.y1<<" "<<a.x1<<endl;
  }
  return 0;
}



Compiler output:
a.cc:48:3: error: 'cout' does not name a type; did you mean 'co'?
   48 |   cout<<ans.size()<<endl;
      |   ^~~~
      |   co
a.cc:49:3: error: expected unqualified-id before 'for'
   49 |   for(auto a:ans){
      |   ^~~
a.cc:52:3: error: expected unqualified-id before 'return'
   52 |   return 0;
      |   ^~~~~~
a.cc:53:1: error: expected declaration before '}' token
   53 | }
      | ^
Language: C++

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

using ll = long long;
// #define int long long
using P = pair<int, int>;
#define LOG(variable) cout << #variable":\t" << (variable) << endl
#define LOGCON(i, container) for(int (i) = 0; (i) < (container).size(); ++(i)) cout << (i) << ":\t" << (container)[(i)] << endl
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(i, r, n) for (int i = (r); i < (n); ++i)
#define REPR(i, n) for(int i = (n); i >= 0; --i) // from n to 0
#define REPRS(i, r, n) for(int i = (n); i >= (r); --i) // from n to r
#define REPOBJ(itr, obj) for(auto itr = (obj).begin(); itr != (obj).end() ; ++itr)
#define REPROBJ(itr, obj) for(auto itr = (obj).rbegin(), e = (obj).rend(); itr != e; ++itr)
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define SORT(obj) sort((obj).begin(), (obj).end())
#define SORTR(obj) sort((obj).begin(), (obj).end(), greater<>())
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))
/***** MAIN *****/
signed main() {
  int H, W;
  cin >> H >> W;
  int coins[H][W];
  REP(i,H) {
    REP(j,W) {
      cin >> coins[i][j];
    }
  }
  int count = 0;
  vector<P> command;
  REP(y,H) {
    REP(x,W) {
      if(coins[y][x]%2 == 0) continue;

      int next_y;
      int next_x;
      if(x == 0) {
        if(W == 1) {
          next_y = y + 1;
          next_x = x;
        } else if(y%2) {
          next_y = y+1;
          next_x = x;
        } else {
          next_y = y;
          next_x = x+1;
        }
      } else if(x == W-1) {
        if(y%2) {
          next_y = y;
          next_x = x - 1;
        } else {
          next_y = y + 1;
          next_x = x;
        }
      } else {
        if(y%2) {
          next_y = y;
          next_x = x - 1;
        } else {
          next_y = y;
          next_x = x + 1;
        }
      }
      if(next_x >= W || next_y >= H) continue;
      ++count;
      --coins[y][x];
      ++coins[next_y][next_x];
      command.PB(P(y+1,x+1));
      command.PB(P(next_y+1,next_x+1))
    }
  }
  cout << count << endl;
  REP(i,count) {
    COUTS(command[i*2].first);
    COUTS(command[i*2].second);
    COUTS(command[i*2+1].first);
    COUTS(command[i*2+1].second);
  }
  return 0;
}
/***** MAIN *****/


Compiler output:
a.cc: In function 'int main()':
a.cc:74:39: error: expected ';' before '}' token
   74 |       command.PB(P(next_y+1,next_x+1))
      |                                       ^
      |                                       ;
   75 |     }
      |     ~