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

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}

int kai(int x) {
	if (x == 1)return 1;
	return kai(x - 1)*x%mod;
}

int mod_pow(int x, int y, int moder) {
	int res = 1;
	while (y > 0) {
		if (y & 1)res = res * x%moder;
		x = x * x%moder;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	if (x == y)return 1;
	return kai(x)* mod_pow(kai(x - y), mod - 2, mod) % mod * mod_pow(kai(y), mod - 2, mod) % mod;
}

int h, w, a[514][514];
int cnt;
vector < pair<pair<int, int>, pair<int, int>>> ans;

signed main() {
	cin >> h >> w;
	rep(i, h) {
		rep(j, w)cin >> a[i][j];
	}
	rep(i, h) {
		if (i % 2 == 0) {
			rep(j, w) {
				if (i == h - 1 && j == w - 1)break;
				if (a[i][j] % 2) {
					cnt++;
					if (j == w - 1) {
						ans.push_back({ { i + 1, j + 1 }, { i + 2, j + 1 } });
						a[i + 1][j]++;1
					}
					else {
						ans.push_back({ {i + 1, j + 1}, {i + 1, j + 2} });
						a[i][j + 1]++;
					}
				}
			}
		}
		else {
			for (int j = w - 1; j >= 0; j--) {
				if (i == h - 1 && w == 0)break;
				if (a[i][j] % 2) {
					cnt++;
					if (j == 0) {
						ans.push_back({ {i + 1,j + 1},{i + 2,j + 1} });
						a[i + 1][j]++;
					}
					else {
						ans.push_back({ {i + 1,j + 1},{i + 1,j} });
						a[i][j - 1]++;
					}
				}
			}
		}
	}
	cout << cnt << endl;
	rep(i, (int)ans.size()) {
		cout << ans[i].first.first << " " << ans[i].first.second << " " << ans[i].second.first << " " << ans[i].second.second << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:64: error: expected ';' before '}' token
   75 |                                                 a[i + 1][j]++;1
      |                                                                ^
      |                                                                ;
   76 |                                         }
      |                                         ~
Language: C++

/* << IN THE NAME OF GOD >> */
#include <bits/stdc++.h>
using namespace std;

#define err(x) cerr << #x << " = " << x << '\n'
const int maxn = 1e8;

long long h ,w ,k ,a[600][600] ,b[maxn] ,c[maxn] ,d[maxn] ,e[maxn];

int  main(){ios::sync_with_stdio(0) ,cout.tie(0) ,cin.tie(0);
    cin >> h >> w;
    for(int i = 1; i <= h; i++)
        for(int j = 1; j <= w; j++)
            cin >> a[i][j];

    for(int i = 1; i <= h; i++)
        for(int j = 1; j <= w; j++)
            if(a[i][j] & 1 && j != w)
                a[i][j + 1]++ ,b[k] = i ,c[k] = j ,d[k] = i ,e[k] = j + 1 ,k++;
            else if(a[i][j] & 1 && i != h)
                a[i + 1][j]++ ,b[k] = i ,c[k] = j ,d[k] = i + 1 ,e[k] = j ,k++;

    cout << k << '\n';

    for(int i = 0; i < k; i++)
        cout << b[i] << " "<< c[i] << " " << d[i] << " " << e[i] << endl;
    return 0;
}








Compiler output:
/tmp/cc1o9C4y.o: in function `main':
a.cc:(.text+0x20d): relocation truncated to fit: R_X86_64_PC32 against symbol `e' defined in .bss section in /tmp/cc1o9C4y.o
a.cc:(.text+0x342): relocation truncated to fit: R_X86_64_PC32 against symbol `e' defined in .bss section in /tmp/cc1o9C4y.o
a.cc:(.text+0x48a): relocation truncated to fit: R_X86_64_PC32 against symbol `e' defined in .bss section in /tmp/cc1o9C4y.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int h,w,i,j,a[500][500],d[2]={1,1},e=0,ni,nj,end=0;
  bool done[500][500]={false};
  vector <pair<pair<int,int>,pair<int,int>>> way;
  cin >> h >> w;
  for (i=0;i<h;i++) for (j=0;j<w;j++) cin >> a[i][j];
  i=0;  j=0;
  while (1){
    if (end==4) break;
    if (done[i][j]||i==-1||i==h||j==-1||j==w){
      i-=ni*d[e];
      j-=nj*d[e];
      d[e]*=-1;
      e=1-e;
      end++;
      continue;
    }
    end=0;
    if (a[i][j]){
      ni=1-e;
      nj=e;
      way.back_push(make_pair(make_pair(i+1,j+1),make_pair(i+1+ni*d[e],j+1+nj*d[e])));
      a[i][j]--;
      a[i+ni*d[e]][j+nj*d[e]]++;
      done[i][j]=true;
    }
    i+=ni*d[e];
    j+=nj*d[e];
  }
  cout << way.size() << endl;
  for (i=0;i<way.size();i++) cout << first.first.way[i] << ' ' << second.first.way[i] << ' ' << first.second.way[i] << ' ' << second.second.way[i] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: 'class std::vector<std::pair<std::pair<int, int>, std::pair<int, int> > >' has no member named 'back_push'
   25 |       way.back_push(make_pair(make_pair(i+1,j+1),make_pair(i+1+ni*d[e],j+1+nj*d[e])));
      |           ^~~~~~~~~
a.cc:34:38: error: 'first' was not declared in this scope
   34 |   for (i=0;i<way.size();i++) cout << first.first.way[i] << ' ' << second.first.way[i] << ' ' << first.second.way[i] << ' ' << second.second.way[i] << endl;
      |                                      ^~~~~
a.cc:34:67: error: 'second' was not declared in this scope
   34 |   for (i=0;i<way.size();i++) cout << first.first.way[i] << ' ' << second.first.way[i] << ' ' << first.second.way[i] << ' ' << second.second.way[i] << endl;
      |                                                                   ^~~~~~
Language: C++

#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <map>
#include <cstdlib>
using namespace std;
 
typedef long long ll;
 
struct PAIR{
    int a;
    int b;
    int c;
    int d;
};
 
int main() {
    int H,W;
    cin >> H >> W;
    vector< vector<int> > coins(H, vector<int>(W));
    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            cin >> coins[i][j];
        }
    }
    
    vector<PAIR> ans;
    for(int h=0; h<H-1; h++){
        for(int w=0; w<W; w++){
            if(coins[h][w]%2==1){
                coins[h+1][w]++;
                PAIR p={h+1, w+1, h+2, w+1};
                ans.push_back(p);
            }
        }
    }
    for(int w=0; w<W-1; w++){
        if(coins[H-1][w]%2==1){
            coins[H-1][w+1]++;
            PAIR p={H, w+1, H, w+2};
            ans.push_back(p);
        }
    }
    cout << ans.size() << endl;
    for(int i=0; i<ans.size(); i++){
        cout << ans[i].a << ' ' << ans[i].b << ' ' << ans[i].c << ' ' << ans[i].d << endl;
    }
 
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:56:14: error: expected '}' at end of input
   56 |     return 0;
      |              ^
a.cc:24:12: note: to match this '{'
   24 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int g[1024][1024];
int main(){
  int h, w; cin >> h >> w;
  vector<tuple<int,int,int,int>> ans;
  for(int i = 0; i < h; i++){
  	for(int j = 0; j < w; j++){
    	cin >> g[i][j];
    }
  }
  for(int i = 0; i < h - 1; i++){
  	for(int j = 0; j < w; j++){
    	if(g[i][j]&1){
        	ans.push_back(make_tuple(i + 1, j + 1, i + 2, j + 1));
          	g[i + 1][j]++;
        }
    }
  }
  for(int j = 0; j < w - 1; j++){
  	if(g[i][j]&1){
      	ans.push_back(make_tuple(h, j + 1, h, j + 2));
    	g[i][j + 1]++;
    }
  }
  cout << ans.size() << endl;
  for(auto it : ans){
    int x, y, z, a; tie(x, y, z, a) = it;
    cout << x << " " << y << " " << z << " " << a << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: 'i' was not declared in this scope
   21 |         if(g[i][j]&1){
      |              ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define ALL(x) x.begin(),x.end()
#define PB push_back
#define LL long long
#define mk make_pair

typedef pair<int,int> pi;

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {
    _for(i,0,v.size()) os << v[i] << " ";
    return os;
}

template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){
    for(typename set<T>::iterator it = v.begin();it != v.end();it++)
    os << *it <<" ";
    return os;
}

int H,W;
int G[505][505];

int main()
{
    scanf("%d %d",&H,&W);
    
    _rep(i,1,H){
        _rep(j,1,W){
            scanf("%d",&G[i][j]);
        }
    }
    
    int i = 1;
    int j = 1;
    int ok = 1;
    int x,y;

    while(i <= H){
        j = 1;
        while(j <= W){
            if(ok && G[i][j]%2){
                ok = 0;
                x = i;y = j;
            }
            else if(!ok){
                vi.PB(x);vi.PB(y);
                vi.PB(i);vi.PB(j);
                x = i;y = j;
                if(G[i][j] % 2) ok = 1;
            }
            j++;
        }

        i++;
        if(i > H) break;

        j = W;
        while(j >= 1){
            if(ok && G[i][j]%2){
                ok = 0;
                x = i;y = j;
            }
            else if(!ok){
                vi.PB(x);vi.PB(y);
                vi.PB(i);vi.PB(j);
                x = i;y = j;
                if(G[i][j] % 2) ok = 1;
            }
            j--;
        }
        i++;
    }


    printf("%d\n",(int)(vi.size()/4));
    for(int i = 0; i < vi.size()/4;i++){
        printf("%d %d %d %d\n",vi[i*4],vi[i*4+1],vi[i*4+2],vi[i*4+3]);

    }


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:17: error: 'vi' was not declared in this scope; did you mean 'i'?
   52 |                 vi.PB(x);vi.PB(y);
      |                 ^~
      |                 i
a.cc:70:17: error: 'vi' was not declared in this scope; did you mean 'i'?
   70 |                 vi.PB(x);vi.PB(y);
      |                 ^~
      |                 i
a.cc:81:25: error: 'vi' was not declared in this scope; did you mean 'i'?
   81 |     printf("%d\n",(int)(vi.size()/4));
      |                         ^~
      |                         i
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second

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

  int H, W; cin >> H >> W;
  bool a[550][550]; //奇数はtrue,偶数はfalse
  rep(i, H) {
      rep(j, W) {
        int a; cin >> a;
        if(a % 2 == 0) a[i][j] = false;
        else a[i][j] = true;
      }
  }
  int N = 0;
  vector<int> y, x, y_, x_;
  rep(i, H) {
      if(i % 2 == 0) {
          rep(j, W - 1) {
              if(a[i][j]) {
                  N ++;
                  a[i][j] = !(a[i][j]);
                  a[i][j + 1] = !(a[i][j + 1]);
                  x.push_back(j + 1); y.push_back(i + 1);
                  x_.push_back(j + 2); y_.push_back(i + 1);
              }
          }
          int j = W - 1;
          if(a[i][j] && i <= H - 2) {
              N ++;
              a[i][j] = !(a[i][j]);
              a[i + 1][j] = !(a[i + 1][j]);
              x.push_back(j + 1); y.push_back(i + 1);
              x_.push_back(j + 1); y_.push_back(i + 2);
          }
      }
      if(i % 2 == 1) {
          per1(j, W - 1) {
              if(a[i][j]) {
                  N ++;
                  a[i][j] = !(a[i][j]);
                  a[i][j - 1] = !(a[i][j - 1]);
                  x.push_back(j + 1); y.push_back(i + 1);
                  x_.push_back(j); y_.push_back(i + 1);
              }
          }
          int j = 0;
          if(a[i][j] && i <= H - 2) {
              N ++;
              a[i][j] = !(a[i][j]);
              a[i + 1][j] = !(a[i + 1][j]);
              x.push_back(j + 1); y.push_back(i + 1);
              x_.push_back(j + 1); y_.push_back(i + 2);
          }
      }
  }

  cout << N << "\n";
  rep(i, N) {
      cout << y[i] << " " << x[i] << " " << y_[i] << " " << x_[i] << "\n";
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:25: error: invalid types 'int[int]' for array subscript
   50 |         if(a % 2 == 0) a[i][j] = false;
      |                         ^
a.cc:51:15: error: invalid types 'int[int]' for array subscript
   51 |         else a[i][j] = true;
      |               ^
Language: C++

import numpy as np

if __name__ == '__main__':
    res = []
    H, W = map(int, input().split())
    f = [list(map(int, input().split())) for i in range(H)]
    for x in range(W-1, 0, -1):
        for y in range(H-1, -1, -1):
            for k in range(f[y][x]):
                res.append((y+1, x+1, y+1, x))
            f[y][x-1] += f[y][x]
            f[y][x] = 0
    for y in range(H-1, 0, -1):
        for k in range(f[y][0]):
            res.append((y+1, 1, y, 1))

    print(len(res))
    for y1, x1, y2, x2 in res:
        print(y1, x1, y2, x2)




Compiler output:
a.cc:3:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    3 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import numpy as np
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mk make_pair
#define sc second
#define fs first
vector < pair < int, int > > ans;
vector < int > ans2;
int n, m, x, a[600][600];
int main(){
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++){
		for (int j = 1; j <= m; j++){
			scanf("%d", &a[i][j]);
		}
	}

	for (int i = 1; i <= n; i++){
		for (int j = 1; j < m; j++){
			if (a[i][j]%2){
				ans.pb(mk(i, j));
				a[i][j+1]++;
			}
		}
	}
	for (int i = 1; i < n; i++){
		if (a[i][m]%2){
			ans2.pb(i);
			a[i+1][m]++;
		}
	}
	printf("%d\n", ans.size()+ans2.size());
	int size = ans.size();
	int size2 = ans2.size();
	for (int i = 0; i  <size; i++){
		printf("%d %d %d %d\n", ans[i].fs, ans[i].sc, ans[i].fc, ans[i].sc+1);
	}
	for (int i = 0; i < size2; i++){
		printf("%d %d %d %d\n", ans2[i],  m, ans2[i]+1, m);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:70: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'fc'
   36 |                 printf("%d %d %d %d\n", ans[i].fs, ans[i].sc, ans[i].fc, ans[i].sc+1);
      |                                                                      ^~
Language: C++

#include <vector>
#include <iostream>
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<int, int> > ord;
	for (int i = 0; i < H; ++i) {
		if (i % 2 == 0) {
			for (int j = 0; j < W; ++j) {
				ord.push_back(make_pair(i, j));
			}
		}
		else {
			for (int j = W - 1; j >= 0; --j) {
				ord.push_back(make_pair(i, j));
			}
		}
	}
	int pre = -1;
	vector<vector<int> > ops;
	for (int i = 0; i < ord.size(); ++i) {
		if (A[ord[i].first][ord[i].second] % 2 == 0) continue;
		if (pre == -1) pre = i;
		else {
			for (int j = pre; j < i; ++j) {
				ops.push_back({ ord[j].first, ord[j].second, ord[j + 1].first, ord[j + 1].second });
			}
		}
	}
	cout << ops.size() << endl;
	for (vector<int> i : v) {
		cout << i[0] + 1 << ' ' << i[1] + 1 << ' ' << i[2] + 1 << ' ' << i[3] + 1 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:30: error: 'v' was not declared in this scope
   38 |         for (vector<int> i : v) {
      |                              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MN=26000;
int x[520][520];
int cnt[MN][4];
int main(){
	int n,m;
	cin>>n>>m;
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			cin>>x[i][j];
		}
	}
	int res=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<m-1;j++){
			if(x[i][j]%2==1){
				x[i][j]--;
				x[i][j+1]++;
				cnt[res][0]=i;
				cnt[res][1]=j;
				cnt[res][2]=i;
				cnt[res][3]=j+1;
				res++;
			}
		}
	}
	int ax=m-1;
	for(int i=0;i<n-1;i++){
		if(x[i][ax]%2==1){
			x[i][ax]--;
			x[i+1][ax]++;
			cnt[res][0]=i;
			cnt[res][1]=w-1;
			cnt[res][2]=i+1;
			cnt[res][3]=w-1;
			res++;
		}
	}
	cout<<res<<endl;
	for(int i=0;i<res;i++){
		cout<<cnt[i][0]+1<<" "<<cnt[i][1]+1<<" "<<cnt[i][2]+1<<" "<<cnt[i][3]+1<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:37: error: 'w' was not declared in this scope
   34 |                         cnt[res][1]=w-1;
      |                                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int H, W;
  cin >> H >> W;
  vector<vector<int>> grid(H, vector<int>(W));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> grid.at(i).at(j);
    }
  }
  
  vector<string> ans(H*W);
  int cnt = 0;
  int n = 0;
  stringstream ss;
  for (int i = 0; i < H; i++) {
    if (i % 2 == 0) { // 右へ走査
      for (int j = 0; j < W; j++) { 
        cnt++;
        if (cnt >= H*W) break;
        if (grid.at(i).at(j) % 2 != 0) {
          n++;
          if (j < W-1) { // まだ端じゃない
            ss << i+1 << " " << j+1 << " " << i+1 << " " << j+2 << endl;
            grid.at(i).at(j+1)++;
          } else { // 端
            ss << i+1 << " " << j+1 << " " << i+2 << " " << j+1 << endl;
            grid.at(i+1).at(j)++;
          }
        }
      }
    } else {
      for (int j = W-1; j > -1; j--) {
        cnt++;
        if (cnt >= H*W) break;
        if (grid.at(i).at(j) % 2 != 0) {
          n++;
          if (j > 0) {
            ss << i+1 << " " << j+1 << " " << i+1 << " " << j << endl;
            grid.at(i).at(j-1)++;
          } else {
            ss << i+1 << " " << j+1 << " " << i+2 << " " << j+1 << endl;
            gird.at(i+1).at(j)++;
          }
        }
      }
    }
  }
  cout << n << endl;
  cout << ss.str();
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:13: error: 'gird' was not declared in this scope; did you mean 'grid'?
   44 |             gird.at(i+1).at(j)++;
      |             ^~~~
      |             grid
Language: C++

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;

int main(){
  int H, W;cin>>H>>W;
  int L=W-1+(H-1)*W;
  vvi a;
  for (int i=0;i<H;++i){
    vi ai;
    for (int j=0;j<W;++j){
      int aij;cin>>aij;
      ai.push_back(aij);
    }
    a.push_back(ai);
  }

  vii path;
  ii position=make_pair(0,0);
  path.push_back(position);
  while(position.first<H&&position.second<W){
    if(position.first==H-1&&position.second%2==0){
      int x=position.second;
      position=make_pair(H-1, x+1);
      path.push_back(position);
    }
    else if(position.first==0&&position.second%2==1){
      int x=position.second;
      position=make_pair(0, x+1);
      path.push_back(position);
    }
    else if(position.second%2==0){
      int y=position.first;
      int x=position.second;
      position=make_pair(y+1, x);
      path.push_back(position);
    }
    else{
      int y=position.first;
      int x=position.second;
      position=make_pair(y-1, x);
      path.push_back(position);
    }
  }

  vector<pair<ii, ii>> move;
  int count=0;

  for(int n=0;n<L;++n){
    ii position = path[n];
    ii nxt_pos=path[n+1];
    int i=position.first;
    int j=position.second;
    int i_=nxt_pos.first;
    int j_=nxt_pos.second;
    if (a[i][j]%2==1){
      ii p=make_pair(i+1,j+1);
      ii q=make_pair(i_+1,j_+1);
      pair<ii, ii> r=make_pair(p,q);
      move.push_back(r);
      count++;
      a[i_][j_]++;
    }
  }

  cout << count << endl;

  for (int c=0;c<count;++c){
    ii p=move[c].first;
    ii q=move[c].second;
    int y=p.first;
    int x=p.second;
    int y_=q.first;
    int x_=q.second;
    printf("%d %d %d %d\n",
                y,
                x,
                y_,
                x_;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:83:19: error: expected ')' before ';' token
   83 |                 x_;
      |                   ^
      |                   )
a.cc:79:11: note: to match this '('
   79 |     printf("%d %d %d %d\n",
      |           ^
Language: C++

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;

int main(){
  int H, W;cin>>H>>W;
  int L=W-1+(H-1)*W;
  vvi a;
  for (int i=0;i<H;++i){
    vi ai;
    for (int j=0;j<W;++j){
      int aij;cin>>aij;
      ai.push_back(aij);
    }
    a.push_back(ai);
  }

  vii path;
  ii position=make_pair(0,0);
  path.push_back(position);
  while(position.first<H&&position.second<W){
    if(position.first==H-1&&position.second%2==0){
      int x=position.second;
      position=make_pair(H-1, x+1);
      path.push_back(position);
    }
    else if(position.first==0&&position.second%2==1){
      int x=position.second;
      position=make_pair(0, x+1);
      path.push_back(position);
    }
    else if(position.second%2==0){
      int y=position.first;
      int x=position.second;
      position=make_pair(y+1, x);
      path.push_back(position);
    }
    else{
      int y=position.first;
      int x=position.second;
      position=make_pair(y-1, x);
      path.push_back(position);
    }
  }

  vector<pair<ii, ii>> move;
  int count=0;

  for(int n=0;n<L;++n){
    ii position = path[n];
    ii nxt_pos=path[n+1];
    int i=position.first;
    int j=position.second;
    int i_=nxt_pos.first;
    int j_=nxt_pos.second;
    if (a[i][j]%2==1){
      ii p=make_pair(i+1,j+1);
      ii q=make_pair(i_+1,j_+1);
      pair<ii, ii> r=make_pair(p,q);
      move.push_back(r);
      count++;
      a[i_][j_]++;
    }
  }

  cout << count << endl;

  for (int c=0;c<count;++c){
    ii p=move[c].first;
    ii q=move[c].second;
    int y=p.first;
    int x=p.second;
    int y_=q.first;
    int x_=q.second;
    cout << y<< %d << x<< %d << y_<< %d << x_<< endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:79:17: error: expected primary-expression before '%' token
   79 |     cout << y<< %d << x<< %d << y_<< %d << x_<< endl;
      |                 ^
a.cc:79:18: error: 'd' was not declared in this scope
   79 |     cout << y<< %d << x<< %d << y_<< %d << x_<< endl;
      |                  ^
a.cc:79:27: error: expected primary-expression before '%' token
   79 |     cout << y<< %d << x<< %d << y_<< %d << x_<< endl;
      |                           ^
a.cc:79:38: error: expected primary-expression before '%' token
   79 |     cout << y<< %d << x<< %d << y_<< %d << x_<< endl;
      |                                      ^
Language: C++

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;

int main(){
  int H, W;cin>>H>>W;
  int L=W-1+(H-1)*W;
  vvi a;
  for (int i=0;i<H;++i){
    vi ai;
    for (int j=0;j<W;++j){
      int aij;cin>>aij;
      ai.push_back(aij);
    }
    a.push_back(ai);
  }

  vii path;
  ii position=make_pair(0,0);
  path.push_back(position);
  while(position.first<H&&position.second<W){
    if(position.first==H-1&&position.second%2==0){
      int x=position.second;
      position=make_pair(H-1, x+1);
      path.push_back(position);
    }
    else if(position.first==0&&position.second%2==1){
      int x=position.second;
      position=make_pair(0, x+1);
      path.push_back(position);
    }
    else if(position.second%2==0){
      int y=position.first;
      int x=position.second;
      position=make_pair(y+1, x);
      path.push_back(position);
    }
    else{
      int y=position.first;
      int x=position.second;
      position=make_pair(y-1, x);
      path.push_back(position);
    }
  }

  vector<pair<ii, ii>> move;
  int count=0;

  for(int n=0;n<L;i++){
    ii position = path[n];
    ii nxt_pos=path[n+1];
    int i=position.first;
    int j=position.second;
    int i_=nxt_pos.first;
    int j_=nxt_pos.second;
    if (a[i][j]%2==1){
      ii p=make_pair(i+1,j+1);
      ii q=make_pair(i_+1,j_+1);
      pair<ii, ii> r=make_pair(p,q);
      move.push_back(r);
      count++;
      a[i_][j_]++;
    }
  }

  cout << count << endl;

  for (int c=0;c<count;++c){
    ii p=move.first;
    ii q=move.second;
    int y=p.first;
    int x=p.second;
    int y_=q.first;
    int x_=q.second;
    cout << y<< x<< y_<< x_<< endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:19: error: 'i' was not declared in this scope
   53 |   for(int n=0;n<L;i++){
      |                   ^
a.cc:73:15: error: 'class std::vector<std::pair<std::pair<int, int>, std::pair<int, int> > >' has no member named 'first'
   73 |     ii p=move.first;
      |               ^~~~~
a.cc:74:15: error: 'class std::vector<std::pair<std::pair<int, int>, std::pair<int, int> > >' has no member named 'second'
   74 |     ii q=move.second;
      |               ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <stdio.h>

using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; i++)
#define rep(i,b) Rep(i,0,b)
#define rrep(i,a) for(int i = a; i >= 0; i--)
#define allof(a) (a).begin(), (a).end()
#define pb push_back

typedef long long ll;
const int inf = 1e9 + 7;
const ll infll = 1ll << 60ll;
const ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

// 最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}

// 最小公約数
long lcm(long a, long b) {
	return a / gcd(a, b) * b;
}

int h, w;

int a[500][500];
vector<pair<int, int>> pa;

int cnt = 0;

void bfs(int i, int j) {
	if (a[i][j] % 2) {
		// 自身より右か下のマスに送る
		if (j + 1 < w) {
			a[i][j]--;
			a[i][j + 1]++;
			pa.push_back({ i+1,j+1 });
			pa.push_back({ i + 1,j+2});
			cnt++;
		}
		else if (i + 1 < h) {
			a[i][j]--;
			a[i + 1][j]++;
			pa.push_back({ i + 1,j + 1 });
			pa.push_back({ i + 2,j + 1 });
			cnt++;
		}
	}
}

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

	memset(a,0,sizeof(a));

	cin >> h >> w;

	// 横がw 縦がh
	rep(i, h) {
		rep(j, w) {
			cin >> a[i][j];
		}
	}

	rep(i, h) {
		rep(j, w) {
			bfs(i, j);
		}
	}

	cout << cnt << endl;
	rep(i, cnt) {
		cout << pa[2 * i].first << " " << pa[2 * i].second << " "
			<< pa[2 * i + 1].first << " " << pa[2 * i + 1].second << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:9: error: 'memset' was not declared in this scope
   70 |         memset(a,0,sizeof(a));
      |         ^~~~~~
a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    9 | #include <sstream>
  +++ |+#include <cstring>
   10 | #include <stdio.h>
Language: C++

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main() {
    int a[505][505];
    int H, W;
    vector<string> ans;

    cin >> H >> W;

    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cin >> a[i][j];
        }
    }

    for (int i = 0; i < W; i++) {
        for (int j = 0; j < H-1; j++) {
            if (a[j][i] % 2 == 1) {
                a[j][i]--;
                a[j+1][i]++;
                ans.push_back( to_string(j+1) + " " + to_string(i+1) + " "
                        + to_string(j+2) + " " + to_string(i+1) );
            }
        }
    }

    for (int i = 0; i < W-1; i++) {
        if (a[H-1][i] % 2 == 1) {
            a[H-1][i]--;
            a[H-1][i+1]++;
            debug();
            ans.push_back( to_string(H) + " " + to_string(i+1) + " "
                        + to_string(H) + " " + to_string(i+2) );
        }
    }

    cout << ans.size() << endl;

    for (auto& e: ans) {
        cout << e << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: 'debug' was not declared in this scope
   35 |             debug();
      |             ^~~~~
Language: C++

#include <cstdio>

int main()
{
	int h,w;
	scanf("%d %d",&h,&w);

	int a[h][w];
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			scanf("%d",&a[i][j]);
		}
	}

	int from[h*w][2],to[h*w][2],tmp=0;
	for(int i=0;i<h;i++){
		int start,def;
		if(i%2) start=w-1; def=-1;
		else start=0; def=1;

		for(int j=start;j>=0 && j<w;j+=def){
			if(a[i][j]%2){
				a[i][j]--; a[i][j+def]++;
				from[tmp][0]=i; from[tmp][1]=j;
				to[tmp][0]=i; to[tmp][1]=j+def;
				tmp++;
			}
		}

		if(i==h-1) break;

		if(def==-1 && a[i][0]%2){
			a[i][0]--; a[i+1][0]++;
			from[tmp][0]=i; from[tmp][1]=0;
			to[tmp][0]=i+1; to[tmp][1]=0;
			tmp++;
		}

		if(def==1 && a[i][w-1]%2){
			a[i][w-1]--; a[i+1][w-1]++;
			from[tmp][0]=i; from[tmp][1]=w-1;
			to[tmp][0]=i+1; to[tmp][1]=w-1;
			tmp++;
		}

	}

	printf("%d\n",tmp);
	for(int i=0;i<tmp;i++){
		printf("%d %d %d %d\n",from[tmp][0],from[tmp][1],to[tmp][0],to[tmp][1]);
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'else' without a previous 'if'
   19 |                 else start=0; def=1;
      |                 ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
int main(){
	int h,w;
	vector<vector<int>> b;
	cin >>h>>w;
	b.resize(h);
	rep(i,h)
		rep(j,w){
		int t;
		cin >>t;
		v[i].push_back(t);
		}
	rep(i,h-1)
		rep(j,w){
			if (v[i][j]%2){
				cout <<i<<" "<<j<<" "<<i+1<<" "<<j<<endl;
				v[i+1][j]++;
			}
		}
	h--;
	rep(j,w-1){
		if (v[h][j]%2){
				cout <<h<<" "<<j<<" "<<h<<" "<<j+1<<endl;
				v[h][j+1]++;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'v' was not declared in this scope
   15 |                 v[i].push_back(t);
      |                 ^
a.cc:19:29: error: 'v' was not declared in this scope
   19 |                         if (v[i][j]%2){
      |                             ^
a.cc:26:21: error: 'v' was not declared in this scope
   26 |                 if (v[h][j]%2){
      |                     ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <math.h>
#include <vector>
#include <cmath>
using namespace std;
int mp[555][555];
struct node
{
    int x1,y1,x2,y2;
    node(int x,int y,int xx,int yy):
        x1(x),y1(y),x2(xx),y2(yy){}
};
 
int main()
{
    vector<node> ans;
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            scanf("%d",&mp[i][j]);
    for(int i=1;i<=n;i++){
        for(int j=1;j<m;j++){
            if(mp[i][j]&1){
                ans.push_back(node(i,j,i,j+1));
                mp[i][j+1]++;
            }
        }
    }
    for(int i=1;i<n;i++){
        if(mp[i][m]&1)
            ans.push_back(node(i,m,i+1,m)),mp[i+1][m]++;
    }
    printf("%d\n",ans.size());
    for(int i=0;i<ans.size();i++){
        printf("%d %d %d %d\n",ans[i].x1,ans[i].y1,ans[i].x2,ans[i].y2);
    }
}
--------------------- 
作者：Mr_Treeeee 
来源：CSDN 
原文：https://blog.csdn.net/Mr_Treeeee/article/details/82687110 
版权声明：本文为博主原创文章，转载请附上博文链接！

Compiler output:
a.cc:40:1: error: expected unqualified-id before '--' token
   40 | ---------------------
      | ^~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
 
int main() {
	int H,W,cnt;
	cin>>H>>W;
	int X[H][W];
	int Y[H][W]={0};
	cnt=0;
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			cin>>X[i][j];
			if(X[i][j]%2==0)X[i][j]=-1;
			else X[i][j]=1;
          y[i][j]=0;
		}
	}
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			if(X[i][j]<1){
				
			}
			else if(j==(W-1)){
				if(i==(H-1))break;
				else {
					X[i][j]*=-1;
					X[i+1][j]*=-1;
					Y[i][j]=2;
					//cout<<i+1<<" "<<j+1;
					//cout<<i+2<<" "<<j+1<<endl;
					cnt++;
				}
			}else{
				X[i][j]*=-1;
				X[i][j+1]*=-1;
				Y[i][j]=1;
				//cout<<i+1<<" "<<j+1;
				//cout<<i+1<<" "<<j+2<<endl;
				cnt++;
			}
		}
	}
	cout<<cnt<<endl;
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			if(Y[i][j]==2){
				cout<<i+1<<" "<<j+1<<" "<<i+2<<" "<<j+1<<endl;
			}else if(Y[i][j]==1){
				cout<<i+1<<" "<<j+1<<" "<<i+1<<" "<<j+2<<endl;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'y' was not declared in this scope
   18 |           y[i][j]=0;
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main() {
    int H, W;
    cin >> H >> W;
    int a[H][W];
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) cin >> a[i][j];
    }

    int N = 0, x1[H * W], y1[H * W], x2[H * W], y2[H * W];
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W - 1; ++j) {
            if (a[i][j] % 2) {
                --a[i][j]; ++a[i][j + 1];
                y1[N] = i + 1; x1[N] = j + 1;
                y2[N] = i + 1; x2[N] = j + 2;
                ++N;
            }
        }
    }
    for (int i = 0; i < H - 1; ++i) {
        if (a[i][W - 1] % 2) {
            --a[i][j]; ++a[i + 1][j];
            y1[N] = i + 1; x1[N] = W;
            y2[N] = i + 2; x2[N] = W;
            ++N;
        }
    }

    cout << N << endl;
    for (int i = 0; i < N; ++i) {
        cout << y1[i] << ' ' << x1[i] << ' ' << y2[i] << ' ' << x2[i] << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: 'j' was not declared in this scope
   25 |             --a[i][j]; ++a[i + 1][j];
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,l,m,t[1004][1004];
vector < pair < int,pair < int,pair < int,int > > > > v;
int main()
{
    ios_base::sync_with_stdio(0);
    scanf("%d %d",&n,&m)
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            scanf("%d",&l)
            t[i][j]+=l;
            if(t[i][j]%2==1&&i!=n)
            {
                t[i+1][j]++;
                v.push_back( { i,{ j, { i+1,j } } } );
            }
            else if(t[i][j]%2==1&&j!=m)
            {
                t[i][j+1]++;
                v.push_back( { i, { j, {i,j+1} } } );
            }
        }
    }
    m=v.size();
    printf("%d\n",m);
    for(int i=0;i<m;i++)
    {
        cout<<v[i].first<<" "<<v[i].second.first<<" "<<v[i].second.second.first<<" "<<v[i].second.second.second;
        if(i!=m-1) cout<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: expected ';' before 'for'
    8 |     scanf("%d %d",&n,&m)
      |                         ^
      |                         ;
    9 |     for(int i=1;i<=n;i++)
      |     ~~~                  
a.cc:9:17: error: 'i' was not declared in this scope
    9 |     for(int i=1;i<=n;i++)
      |                 ^
Language: C

#include <stdio.h>
int main(void){
	int h,w;
	scanf("%d%d",&h,&w);
	int b[h];
	for(int i=0;i<h;i++){
		b[i]=0;
	}
	int a[h][w];
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			scanf("%d",&a[i][j]);
			if(a[i][j]%2)b[i]++;
		}
	}
	int n=0;
	int e,f;
	for(int i=0;i<h;i++){
		e=0;f=-1;
		for(int j=0;j<b[i]/2;j++){
			e=f+1;
			while(a[i][e]%2==0)e++;
			f=e+1;
			while(a[i][f]%2==0)f++;
			n+=f-e;
			for(int k=f;k>e;k--){
				//printf("%d %d %d %d\n",i+1,k+1,i+1,k);
			}
		}
		if(b[i]%2){
			e=f+1;
			while(a[i][e]%2==0)e++;
			n+=w-1-e;
			for(int k=e;k<w-1;k++){
				//printf("%d %d %d %d\n",i+1,k+1,i+1,k);
			}
		}
	}
	int m=0;
	for(int i=0;i<h;i++){
		m+=b[i]%2;
	}
	f=-1;
	for(int i=0;i<m/2;i++){
		e=f+1;
		while(b[e]%2==0)e++;
		f=e+1;
		while(b[f]%2==0)f++;
		n+=f-e;
		for(int k=f;k>e;k--){
			//printf("%d %d %d %d\n",k+1,n,k,n);
		}
	}
	
	printf("%d\n",n);
	
	for(int i=0;i<h;i++){
		e=0;f=-1;
		for(int j=0;j<b[i]/2;j++){
			e=f+1;
			while(a[i][e]%2==0)e++;
			f=e+1;
			while(a[i][f]%2==0)f++;
			n+=f-e;
			for(int k=f;k>e;k--){
				printf("%d %d %d %d\n",i+1,k+1,i+1,k);
			}
		}
		if(b[i]%2){
			e=f+1;
			while(a[i][e]%2==0)e++;
			n+=w-1-e;
			for(int k=e;k<w-1;k++){
				printf("%d %d %d %d\n",i+1,k+1,i+1,k+2);
			}
		}
	}
	
	f=-1;
	for(int i=0;i<m/2;i++){
		e=f+1;
		while(b[e]%2==0)e++;
		f=e+1;
		while(b[f]%2==0)f++;
		n+=f-e;
		for(int k=f;k>e;k--){
			printf("%d %d %d %d\n",k+1,w,k,w);
		}
	}
}#include <stdio.h>
int main(void){
	int h,w;
	scanf("%d%d",&h,&w);
	int b[h];
	for(int i=0;i<h;i++){
		b[i]=0;
	}
	int a[h][w];
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			scanf("%d",&a[i][j]);
			if(a[i][j]%2)b[i]++;
		}
	}
	int n=0;
	int e,f;
	for(int i=0;i<h;i++){
		e=0;f=-1;
		for(int j=0;j<b[i]/2;j++){
			e=f+1;
			while(a[i][e]%2==0)e++;
			f=e+1;
			while(a[i][f]%2==0)f++;
			n+=f-e;
			for(int k=f;k>e;k--){
				//printf("%d %d %d %d\n",i+1,k+1,i+1,k);
			}
		}
		if(b[i]%2){
			e=f+1;
			while(a[i][e]%2==0)e++;
			n+=w-1-e;
			for(int k=e;k<w-1;k++){
				//printf("%d %d %d %d\n",i+1,k+1,i+1,k);
			}
		}
	}
	int m=0;
	for(int i=0;i<h;i++){
		m+=b[i]%2;
	}
	f=-1;
	for(int i=0;i<m/2;i++){
		e=f+1;
		while(b[e]%2==0)e++;
		f=e+1;
		while(b[f]%2==0)f++;
		n+=f-e;
		for(int k=f;k>e;k--){
			//printf("%d %d %d %d\n",k+1,n,k,n);
		}
	}
	
	printf("%d\n",n);
	
	for(int i=0;i<h;i++){
		e=0;f=-1;
		for(int j=0;j<b[i]/2;j++){
			e=f+1;
			while(a[i][e]%2==0)e++;
			f=e+1;
			while(a[i][f]%2==0)f++;
			n+=f-e;
			for(int k=f;k>e;k--){
				printf("%d %d %d %d\n",i+1,k+1,i+1,k);
			}
		}
		if(b[i]%2){
			e=f+1;
			while(a[i][e]%2==0)e++;
			n+=w-1-e;
			for(int k=e;k<w-1;k++){
				printf("%d %d %d %d\n",i+1,k+1,i+1,k+2);
			}
		}
	}
	
	f=-1;
	for(int i=0;i<m/2;i++){
		e=f+1;
		while(b[e]%2==0)e++;
		f=e+1;
		while(b[f]%2==0)f++;
		n+=f-e;
		for(int k=f;k>e;k--){
			printf("%d %d %d %d\n",k+1,w,k,w);
		}
	}
}

Compiler output:
main.c:90:2: error: stray '#' in program
   90 | }#include <stdio.h>
      |  ^
main.c:90:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   90 | }#include <stdio.h>
      |           ^
Language: C++

//QWsin
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,x,y) for(int i=x;i<=y;++i)
#define out(i,u) for(int i=first[u];i!=-1;i=next[i])
#define repvc(i,vc) for(int i=0,Sz=vc.size();i<Sz;++i)

using namespace std;

const int INF=1<<30;

const int maxn=500+10;

int mx[maxn][maxn];

struct Node{
	int a,b,c,d;	
	Node(int a=0,int b=0,int c=0,int d=0):a(a),b(b),c(c),d(d){}
	inline void output(){printf("%d %d %d %d\n",a,b,c,d);}
};

vector<Node>vc;

inline void output(int a,int b,int c,int d){
	vc.push_back(Node(a,b,c,d));
	--mx[a][b];++mx[c][d];
}

int main()
{
	int n,m;cin>>n>>m;
	rep(i,1,n) rep(j,1,m) scanf("%d",mx[i]+j);
	rep(i,1,n) rep(j,1,m){
		if(mx[i][j]&1)	
		{
			if(j<m)output(i,j,i,j+1);	
			else if(i<n) output(i,j,i+1,j);
		}
	}
	
	cout<<vc.size()<<endl;
	repvc(i,vc) vc[i].output();
	return 0;
}


Compiler output:
a.cc:24:1: error: 'vector' does not name a type
   24 | vector<Node>vc;
      | ^~~~~~
a.cc: In function 'void output(int, int, int, int)':
a.cc:27:9: error: 'vc' was not declared in this scope; did you mean 'c'?
   27 |         vc.push_back(Node(a,b,c,d));
      |         ^~
      |         c
a.cc: In function 'int main()':
a.cc:43:15: error: 'vc' was not declared in this scope
   43 |         cout<<vc.size()<<endl;
      |               ^~
Language: C++

using namespace std;
const int N=500;
struct ANS {
    int a,b,c,d;
    ANS(int x,int y,int z,int w):a(x),b(y),c(z),d(w) {};
};
vector<ANS> ans;
int r,c;
int val[N+5][N+5];
bool vis[N+5][N+5];
int main() {
    scanf("%d%d",&r,&c);
    for(int i=0; i<r; i++)
        for(int j=0; j<c; j++)
            scanf("%d",&val[i][j]),
            val[i][j]&=1; //只保存奇偶性
    for(int i=0; i<r; i++) //推第一列到倒数第二列
        for(int j=0; j<c-1; j++) //把(i,j)推到(i,j+1)
            if(val[i][j]) //只操作奇数点
                val[i][j+1]^=val[i][j],
                ans.push_back(ANS(i+1,j+1,i+1,j+2)); //保存操作
    for(int i=0; i<r-1; i++) //推最后一列
        if(val[i][c-1]) //之推奇数
            val[i+1][c-1]^=val[i][c-1],
            ans.push_back(ANS(i+1,c,i+2,c)); //保存操作
    //P.S. "^"是异或，这里用来改变奇偶性
    printf("%d\n",ans.size());
    for(int i=0; i<ans.size(); i++)
        printf("%d %d %d %d\n",ans[i].a,ans[i].b,ans[i].c,ans[i].d);
    return 0;
}

Compiler output:
a.cc:7:1: error: 'vector' does not name a type
    7 | vector<ANS> ans;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:12:5: error: 'scanf' was not declared in this scope
   12 |     scanf("%d%d",&r,&c);
      |     ^~~~~
a.cc:21:17: error: 'ans' was not declared in this scope
   21 |                 ans.push_back(ANS(i+1,j+1,i+1,j+2)); //保存操作
      |                 ^~~
a.cc:25:13: error: 'ans' was not declared in this scope
   25 |             ans.push_back(ANS(i+1,c,i+2,c)); //保存操作
      |             ^~~
a.cc:27:19: error: 'ans' was not declared in this scope
   27 |     printf("%d\n",ans.size());
      |                   ^~~
a.cc:27:5: error: 'printf' was not declared in this scope
   27 |     printf("%d\n",ans.size());
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | using namespace std;
Language: C++

import java.util.Scanner;

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

		int y, x;
		y = sc.nextInt();
		x = sc.nextInt();

		System.out.println(x * (y - 1) + x - 1);

		for(int i = 1; i <= y - 1; i++){
			for(int j = 1; j <= x; j++){
				System.out.println(Integer.toString(i) + " " + Integer.toString(j) + " " + Integer.toString(i + 1) + " " + Integer.toString(j));
			}
		}
		for(int i = 1; i <= x - 1; i++){
			System.out.println(Integer.toString(y) + " " + Integer.toString(i) + " " + Integer.toString(y) + " " + Integer.toString(i + 1));
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include<algorithm>
#include<cmath>
#include<functional>
#include<iostream>
#include<map>
#include<math.h>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<string.h>
#include<unordered_map>
#include<vector>
using namespace std;
typedef long long ll;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define map unordered_map
int inf = LLONG_MAX / 3;

int h, w, a[550][550];
struct stru{ int a, b, c, d; };
queue<stru> q;
signed main() {
	cin >> h >> w;
	int cnt = 0;
	rep(i, h) {
		rep(j, w) {
			cin >> a[i][j];
			if (a[i][j] % 2)cnt++;
		}
	}
	bool b = false;
	int cnt2 = 0;
	int sum = 0;
	rep(i, h) {
		if (i % 2) {
			for (int j = w - 1; j >= 0; j--) {
				if (a[i][j] % 2) {
					if (b) {
						b = false;
						cnt2++;
					}
					else if (cnt != cnt2 * 2 + 1)b = true;
				}
				if (b)q.push({ i + 1,j + 1,i + 1,j });
			}
			if (a[i][0] % 2) {
				if (b) {
					b = false;
					cnt2++;
				}
				else if (cnt != cnt2 * 2 + 1)b = true;
			}
			if (b)q.push({ i + 1,1,i + 2,1 });
		}
		else {
			rep(j, w - 1) {
				if (a[i][j] % 2) {
					if (b) {
						b = false;
						cnt2++;
					}
					else if (cnt != cnt2 * 2 + 1)b = true;
				}
				if (b)q.push({ i + 1,j + 1,i + 1,j + 2 });
			}
			if (a[i][w - 1] % 2) {
				if (b) {
					b = false;
					cnt2++;
				}
				else if (cnt != cnt2 * 2 + 1)b = true;
			}
			if (b)q.push({ i + 1,w,i + 2,w });
		}
	}
	cout << q.size() << endl;
	while(!q.empty()) {
		stru str = q.front();
		q.pop();
		cout << str.a << " " << str.b << " " << str.c << " " << str.d << endl;
	}
	return 0;
}

Compiler output:
a.cc:19:11: error: 'LLONG_MAX' was not declared in this scope
   19 | int inf = LLONG_MAX / 3;
      |           ^~~~~~~~~
a.cc:12:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include<string.h>
  +++ |+#include <climits>
   12 | #include<unordered_map>
Language: C++

#include <iostream>
using namespace std;
int main(){
    int h,w;cin>>h>>w;
    int a[h][w]={};
    for(int i=0; i<h-1; i++){
        for(int j=0; j<w; j++){
            if(a[i][j]%2==1){
                a[i][j]--;
                a[i+1][j]++;
                cout<<i<<" "<<" "j<<" "<<i+1<<" "<<j<<endl;
            }
        }
    }
    for(int i=0; i<w-1; i++){
        if(a[h-1][i]%2==1){
            a[h-1][i]--;
            a[h-1][i+1]++;
            cout<<h-1<<" "<<i<<" "<<h-1<<" "<<i+1<<endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:31: error: unable to find string literal operator 'operator""j' with 'const char [2]', 'long unsigned int' arguments
   11 |                 cout<<i<<" "<<" "j<<" "<<i+1<<" "<<j<<endl;
      |                               ^~~~
Language: C++

#include<algorithm>
#include<cmath>
#include<functional>
#include<iostream>
#include<map>
#include<math.h>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<string.h>
#include<unordered_map>
#include<vector>
using namespace std;
typedef long long ll;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define map unordered_map
int inf = LLONG_MAX / 3;

int h, w, a[550][550];
signed main() {
	cin >> h >> w;
	int cnt = 0;
	rep(i, h) {
		rep(j, w) {
			cin >> a[i][j];
			if (a[i][j] % 2)cnt++;
		}
	}
	bool b = false;
	int cnt2 = 0;
	rep(i, h) {
		if (i % 2) {
			for (int j = w - 1; j >= 0; j--) {
				if (a[i][j] % 2) {
					if (b) {
						b = false;
						cnt2++;
					}
					else if (cnt != cnt2 * 2 + 1)b = true;
				}
				if (b)cout << i + 1 << " " << j + 1 << " " << i + 1 << " " << j << endl;
			}
			if (a[i][0] % 2) {
				if (b) {
					b = false;
					cnt2++;
				}
				else if (cnt != cnt2 * 2 + 1)b = true;
			}
			if (b)cout << i + 1 << " " << 1 << " " << i + 2 << " " << 1 << endl;
		}
		else {
			rep(j, w - 1) {
				if (a[i][j] % 2) {
					if (b) {
						b = false;
						cnt2++;
					}
					else if (cnt != cnt2 * 2 + 1)b = true;
				}
				if (b)cout << i + 1 << " " << j + 1 << " " << i + 1 << " " << j + 2 << endl;
			}
			if (a[i][w - 1] % 2) {
				if (b) {
					b = false;
					cnt2++;
				}
				else if (cnt != cnt2 * 2 + 1)b = true;
			}
			if (b)cout << i + 1 << " " << w << " " << i + 2 << " " << w << endl;
		}
	}
	return 0;
}

Compiler output:
a.cc:19:11: error: 'LLONG_MAX' was not declared in this scope
   19 | int inf = LLONG_MAX / 3;
      |           ^~~~~~~~~
a.cc:12:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include<string.h>
  +++ |+#include <climits>
   12 | #include<unordered_map>
Language: C++

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

int main(){
    int H, W;
    cin >> H >> W;
    int a[H][W];
    REP(i, H)REP(j, W){
        cin >> a[i][j];
        a[i][j] %= 2;
    }
    bool on = false;
    int previ, prevj;
    vector<int> x, y, z, w;
    REP(i, H)REP(k, W){
        cout << i << " " << j << endl;
        if(on){
            if(a[i][j]==1){
                on =false;
            }
            x.push_back(previ);
            y.push_back(prevj);
            z.push_back(i);
            w.push_back(j);
        }else{
            if(a[i][j]==1){
                on = true;
            }
        }
        previ = i;
        prevj = j;
    }
    cout << x.size() << endl;
    REP(i, x.size()){
        printf("%d %d %d %d\n", x[i]+1, y[i]+1, z[i]+1, w[i]+1);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:29: error: 'j' was not declared in this scope
   24 |         cout << i << " " << j << endl;
      |                             ^