Language: C++

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

typedef long long  ll;

ll MOD = 1000000007;
ll INF = 100000000000000;
double PI = 3.1415926535;

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}

using Graph = vector<vector<pair<ll,ll>>>;

int H,W;
int table[510][510];
int dy[4]{-1,0,1,0};
int dx[4]{0,-1,0,1};

int main(){
  cin >> H >> W;
  for(int i = 0;i < H;i++){
    for(int j = 0;j < W;j++){
      cin >> table[i][j];
    }
  }
  vector<tuple<int,int,int,int>> ans;
  int cnt = 0;
  for(int i = 0;i < H;i++){
    for(int j = 0;j < W;j++){
      for(int k = 0;k < 4;k++){
        int ny = i + dy[k],nx = j + dx[k];
        if(0 <= ny && ny < H && 0 <= nx && nx < W){
          if(table[i][j] % 2 == 1){
            if(table[ny][nx]) % 2 == 1){
              table[ny][nx]++;
              table[i][j]--;
              ans.push_back(make_tuple(i+1,j+1,ny+1,nx+1));
              cnt++;
            }
          }
        }
      }
    }
  }
  for(int i = 0;i < cnt;i++){
    cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
  }
  cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:31: error: expected primary-expression before '%' token
   38 |             if(table[ny][nx]) % 2 == 1){
      |                               ^
a.cc:50:19: error: no matching function for call to 'get<0>(std::vector<std::tuple<int, int, int, int> >&)'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:1250:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(pair<_Tp1, _Tp2>&)'
 1250 |     get(pair<_Tp1, _Tp2>& __in) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1250:5: note:   template argument deduction/substitution failed:
a.cc:50:19: note:   'std::vector<std::tuple<int, int, int, int> >' is not derived from 'std::pair<_Tp1, _Tp2>'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
/usr/include/c++/14/bits/stl_pair.h:1255:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(pair<_Tp1, _Tp2>&&)'
 1255 |     get(pair<_Tp1, _Tp2>&& __in) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1255:5: note:   template argument deduction/substitution failed:
a.cc:50:19: note:   'std::vector<std::tuple<int, int, int, int> >' is not derived from 'std::pair<_Tp1, _Tp2>'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
/usr/include/c++/14/bits/stl_pair.h:1260:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(const pair<_Tp1, _Tp2>&)'
 1260 |     get(const pair<_Tp1, _Tp2>& __in) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1260:5: note:   template argument deduction/substitution failed:
a.cc:50:19: note:   'std::vector<std::tuple<int, int, int, int> >' is not derived from 'const std::pair<_Tp1, _Tp2>'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
/usr/include/c++/14/bits/stl_pair.h:1265:5: note: candidate: 'template<long unsigned int _Int, class _Tp1, class _Tp2> constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(const pair<_Tp1, _Tp2>&&)'
 1265 |     get(const pair<_Tp1, _Tp2>&& __in) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1265:5: note:   template argument deduction/substitution failed:
a.cc:50:19: note:   'std::vector<std::tuple<int, int, int, int> >' is not derived from 'const std::pair<_Tp1, _Tp2>'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/string:68,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/tuple:2445:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(tuple<_Elements ...>&)'
 2445 |     get(tuple<_Elements...>& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2445:5: note:   template argument deduction/substitution failed:
a.cc:50:19: note:   'std::vector<std::tuple<int, int, int, int> >' is not derived from 'std::tuple<_Elements ...>'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
/usr/include/c++/14/tuple:2451:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >& std::get(const tuple<_Elements ...>&)'
 2451 |     get(const tuple<_Elements...>& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2451:5: note:   template argument deduction/substitution failed:
a.cc:50:19: note:   'std::vector<std::tuple<int, int, int, int> >' is not derived from 'const std::tuple<_Elements ...>'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
/usr/include/c++/14/tuple:2457:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >&& std::get(tuple<_Elements ...>&&)'
 2457 |     get(tuple<_Elements...>&& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2457:5: note:   template argument deduction/substitution failed:
a.cc:50:19: note:   'std::vector<std::tuple<int, int, int, int> >' is not derived from 'std::tuple<_Elements ...>'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
/usr/include/c++/14/tuple:2466:5: note: candidate: 'template<long unsigned int __i, class ... _Elements> constexpr std::__tuple_element_t<__i, std::tuple<_Elements ...> >&& std::get(const tuple<_Elements ...>&&)'
 2466 |     get(const tuple<_Elements...>&& __t) noexcept
      |     ^~~
/usr/include/c++/14/tuple:2466:5: note:   template argument deduction/substitution failed:
a.cc:50:19: note:   'std::vector<std::tuple<int, int, int, int> >' is not derived from 'const std::tuple<_Elements ...>'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
In file included from /usr/include/c++/14/functional:65,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/array:390:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp& std::get(array<_Tp, _Nm>&)'
  390 |     get(array<_Tp, _Nm>& __arr) noexcept
      |     ^~~
/usr/include/c++/14/array:390:5: note:   template argument deduction/substitution failed:
a.cc:50:19: note:   'std::vector<std::tuple<int, int, int, int> >' is not derived from 'std::array<_Tp, _Nm>'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
/usr/include/c++/14/array:399:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr _Tp&& std::get(array<_Tp, _Nm>&&)'
  399 |     get(array<_Tp, _Nm>&& __arr) noexcept
      |     ^~~
/usr/include/c++/14/array:399:5: note:   template argument deduction/substitution failed:
a.cc:50:19: note:   'std::vector<std::tuple<int, int, int, int> >' is not derived from 'std::array<_Tp, _Nm>'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
/usr/include/c++/14/array:408:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp& std::get(const array<_Tp, _Nm>&)'
  408 |     get(const array<_Tp, _Nm>& __arr) noexcept
      |     ^~~
/usr/include/c++/14/array:408:5: note:   template argument deduction/substitution failed:
a.cc:50:19: note:   'std::vector<std::tuple<int, int, int, int> >' is not derived from 'const std::array<_Tp, _Nm>'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
/usr/include/c++/14/array:417:5: note: candidate: 'template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp&& std::get(const array<_Tp, _Nm>&&)'
  417 |     get(const array<_Tp, _Nm>&& __arr) noexcept
      |     ^~~
/usr/include/c++/14/array:417:5: note:   template argument deduction/substitution failed:
a.cc:50:19: note:   'std::vector<std::tuple<int, int, int, int> >' is not derived from 'const std::array<_Tp, _Nm>'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
/usr/include/c++/14/bits/stl_pair.h:1272:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp& std::get(pair<_T1, _T2>&)'
 1272 |     get(pair<_Tp, _Up>& __p) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1272:5: note:   template argument deduction/substitution failed:
a.cc:50:19: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Up> constexpr _Tp& std::get(pair<_T1, _T2>&)'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
a.cc:50:19: note:   expected a type, got '0'
/usr/include/c++/14/bits/stl_pair.h:1277:5: note: candidate: 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const pair<_T1, _T2>&)'
 1277 |     get(const pair<_Tp, _Up>& __p) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1277:5: note:   template argument deduction/substitution failed:
a.cc:50:19: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Up> constexpr const _Tp& std::get(const pair<_T1, _T2>&)'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~^~~~~
a.cc:50:19: note:   expected a type, got '0'
/usr/include/c++/14/bits/stl_pair.h:1282:5: note: candidate: 'template<class _Tp, class _Up> constexpr _Tp&& std::get(pair<_T1, _T2>&&)'
 1282 |     get(pair<_Tp, _Up>&& __p) noexcept
      |     ^~~
/usr/include/c++/14/bits/stl_pair.h:1282:5: note:   template argument deduction/substitution failed:
a.cc:50:19: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Up> constexpr _Tp&& std::get(pair<_T1, _T2>&&)'
   50 |     cout << get<0>(ans) << ' ' << get<1>(ans) < ' ' << get<2>(ans) << ' ' << get<3>(ans);
      |             ~~~~~~