Language: C++

#include<cstdio>
#include<vector>
#include<cstring>
using namespace std;
#define L 503

struct move {
	int x,y,tx,ty;
};
int dir[4][2]={
	{1,0},{-1,0},{0,1},{0,-1}
};
int n,m;
int num[L][L];
bool vis[L][L];
bool dfs[L][L];
vector<move>ans;

void Dfs(int x,int y) {
	dfs[x][y]=true;
	for(int i=0;i<4;i++) {
		int tx=x+dir[i][0];
		int ty=y+dir[i][1];
		if(!dfs[tx][ty])
			Dfs(tx,ty);
		if(!vis[tx][ty]&&!vis[x][y]) {
			vis[x][y]=vis[tx][ty]=true;
			if(num[x][y]>num[tx][ty])
				ans.push_back((move){x,y,tx,ty});
			else ans.push_back((move){tx,ty,x,y});
		}
	}
}
int main() {
	memset(vis,1,sizeof(vis));
	memset(dfs,1,sizeof(dfs));
	scanf("%d %d",&n,&m);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++) {
			scanf("%d",&num[i][j]);
			if(num[i][j]%2==1)
				vis[i][j]=dfs[i][j]=false;
		}
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
			if(!vis[i][j])
				Dfs(i,j);
	printf("%d\n",ans.size());
	for(int i=0;i<ans.size();i++)
		printf("%d %d %d %d\n",ans[i].x,ans[i].y,ans[i].tx,ans[i].ty);
	return 0;
}

Compiler output:
a.cc:17:12: error: template argument 1 is invalid
   17 | vector<move>ans;
      |            ^
a.cc:17:12: error: template argument 2 is invalid
a.cc: In function 'void Dfs(int, int)':
a.cc:29:37: error: request for member 'push_back' in 'ans', which is of non-class type 'int'
   29 |                                 ans.push_back((move){x,y,tx,ty});
      |                                     ^~~~~~~~~
a.cc:29:48: error: reference to 'move' is ambiguous
   29 |                                 ans.push_back((move){x,y,tx,ty});
      |                                                ^~~~
In file included from /usr/include/c++/14/vector:62,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:675:5: note: candidates are: 'template<class _II, class _OI> _OI std::move(_II, _II, _OI)'
  675 |     move(_II __first, _II __last, _OI __result)
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
                 from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/bits/move.h:137:5: note:                 'template<class _Tp> constexpr typename std::remove_reference<_Tp>::type&& std::move(_Tp&&)'
  137 |     move(_Tp&& __t) noexcept
      |     ^~~~
a.cc:7:8: note:                 'struct move'
    7 | struct move {
      |        ^~~~
a.cc:30:34: error: request for member 'push_back' in 'ans', which is of non-class type 'int'
   30 |                         else ans.push_back((move){tx,ty,x,y});
      |                                  ^~~~~~~~~
a.cc:30:45: error: reference to 'move' is ambiguous
   30 |                         else ans.push_back((move){tx,ty,x,y});
      |                                             ^~~~
/usr/include/c++/14/bits/stl_algobase.h:675:5: note: candidates are: 'template<class _II, class _OI> _OI std::move(_II, _II, _OI)'
  675 |     move(_II __first, _II __last, _OI __result)
      |     ^~~~
/usr/include/c++/14/bits/move.h:137:5: note:                 'template<class _Tp> constexpr typename std::remove_reference<_Tp>::type&& std::move(_Tp&&)'
  137 |     move(_Tp&& __t) noexcept
      |     ^~~~
a.cc:7:8: note:                 'struct move'
    7 | struct move {
      |        ^~~~
a.cc: In function 'int main()':
a.cc:48:27: error: request for member 'size' in 'ans', which is of non-class type 'int'
   48 |         printf("%d\n",ans.size());
      |                           ^~~~
a.cc:49:27: error: request for member 'size' in 'ans', which is of non-class type 'int'
   49 |         for(int i=0;i<ans.size();i++)
      |                           ^~~~
a.cc:50:43: error: invalid types 'int[int]' for array subscript
   50 |                 printf("%d %d %d %d\n",ans[i].x,ans[i].y,ans[i].tx,ans[i].ty);
      |                                           ^
a.cc:50:52: error: invalid types 'int[int]' for array subscript
   50 |                 printf("%d %d %d %d\n",ans[i].x,ans[i].y,ans[i].tx,ans[i].ty);
      |                                                    ^
a.cc:50:61: error: invalid types 'int[int]' for array subscript
   50 |                 printf("%d %d %d %d\n",ans[i].x,ans[i].y,ans[i].tx,ans[i].ty);
      |                                                             ^
a.cc:50:71: error: invalid types 'int[int]' for array subscript
   50 |                 printf("%d %d %d %d\n",ans[i].x,ans[i].y,ans[i].tx,ans[i].ty);
      |                                                                       ^