Language: C++

#include<bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define puba push_back
#define pufro push_front
#define poba pop_back
#define pofro pop_front

using namespace std;
typedef long long ll;
const ll M=1e9+7;
const double PI=acos(-1);
const double EPS=1e-12;
const ll arrSize=2000005;
ll arr[arrSize];
ll grid[505][505];
int main(){
	int tc=1,kasus=1;
	//scanf("%d",&tc);
	while(tc--){
		int r,c;
		scanf("%d %d",&r,&c);
		
		bool carry=false;
		vector<pair<pair<ll,ll>,pair<ll,ll> > >vec;
		pair<int,int>p;
		for(int i=0;i<r;i++) for(int j=0;j<c;j++) scanf("%lld",&grid[i][j]);
		for(int i=0;i<r;i++){
			for(int j=0;j<c;j++){
				if(grid[i][j]&1){
					if(carry){
						carry=false;
						if(p.fi-1==i || p.se-1==j){
							vec.puba(p,mp(i+1,j+1));
						}
						
						else{
							vec.puba(p,mp(p.fi,j+1));
							vec.puba(mp(p.fi,j+1),mp(i+1,j+1));
						}
					}
					
					else{
						carry=true;
						p=mp(i+1,j+1);
					}
				}
			}
			carry=false;
		}
		
		
		printf("%d\n",(int)vec.size());
		
		for(int i=0;i<vec.size();i++){
			printf("%lld %lld %lld %lld\n",vec[i].fi.fi,vec[i].fi.se,vec[i].se.fi,vec[i].se.se);
		}
		
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:65: error: no matching function for call to 'std::vector<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > >::push_back(std::pair<int, int>&, std::pair<int, int>)'
   35 |                                                         vec.puba(p,mp(i+1,j+1));
      |                                                         ~~~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; value_type = std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> >]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; value_type = std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> >]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
a.cc:39:65: error: no matching function for call to 'std::vector<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > >::push_back(std::pair<int, int>&, std::pair<int, int>)'
   39 |                                                         vec.puba(p,mp(p.fi,j+1));
      |                                                         ~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; value_type = std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> >]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; value_type = std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> >]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
a.cc:40:65: error: no matching function for call to 'std::vector<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > >::push_back(std::pair<int, int>, std::pair<int, int>)'
   40 |                                                         vec.puba(mp(p.fi,j+1),mp(i+1,j+1));
      |                                                         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; value_type = std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> >]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; value_type = std::pair<std::pair<long long int, long long int>, std::pair<long long int, long long int> >]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided