Language: C++

#include <bits/stdc++.h>
typedef long long int ll;
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EREP(i, n) for (int i = (n)-1; i >= 0; --i)
#define mod 1000000007
#define pb(a) push_back((a))
#define INF 93193111451418101
#define MIN -93193111451418101
#define EPS 1e-11
//#define INF 931931114518101
using namespace std;
typedef pair<ll, ll> P;
template <typename T> void fill_all(T &arr, const T &v) { arr = v; }
template <typename T, typename ARR> void fill_all(ARR &arr, const T &v) {
  for (auto &i : arr) {
    fill_all(i, v);
  }
}
//------------------変数-----------------------//
ll h,w;
char grid[501][501];
ll 4x[]={0,1,0,-1,0};
bool blue[501][501],red[501][501],vis[501][501];
P road[501][501];
//-------------------関数----------------------//
bool in(ll y,ll x){
    if(y<0||x<0||y==h||x==w){
        return false;
    }
    return true;
}

int main() {
    cin>>h>>w;
    ll fx,fy,db=0;
    REP(i,h){
        REP(j,w){
            cin>>grid[i][j];
            fy=i;fx=j;
        if(grid[i][j]=='#'){db++;}
        }
    }
    std::queue<P>q ;
    q.push_back(P(i,j));
    ll dbledcnt=0;
    while(!q.empty()){
     ll y=q.front.first;
     ll x=q.front.second;
     if(grid[y][x]=='#'){
         ll ky=road[y][x].first,kx=road[y][x].second;
         while(grid[ky][kx]!='#'){
     ky=road[y][x].first,kx=road[y][x].second;
         }
     }
     REP(i,4){
         if(in(y+4x[i],x+4x[i+1]&&!vis[y+4x[i]][x+4x[i+1]])){
             vis[y+4x[i]][x+4x[i+1]]=1;
             q.pb(P(y+4x[i],x+4x[i+1]));
             road[y+4x[i]][x+4x[i+1]]=P(y,x);
         }
     }
    }
    
}

Compiler output:
a.cc:23:4: error: expected unqualified-id before numeric constant
   23 | ll 4x[]={0,1,0,-1,0};
      |    ^~
a.cc: In function 'int main()':
a.cc:45:7: error: 'class std::queue<std::pair<long long int, long long int> >' has no member named 'push_back'
   45 |     q.push_back(P(i,j));
      |       ^~~~~~~~~
a.cc:45:19: error: 'i' was not declared in this scope
   45 |     q.push_back(P(i,j));
      |                   ^
a.cc:45:21: error: 'j' was not declared in this scope
   45 |     q.push_back(P(i,j));
      |                     ^
a.cc:48:13: error: invalid use of member function 'std::queue<std::pair<long long int, long long int> >::front' (did you forget the '()' ?)
   48 |      ll y=q.front.first;
      |           ~~^~~~~
a.cc:49:13: error: invalid use of member function 'std::queue<std::pair<long long int, long long int> >::front' (did you forget the '()' ?)
   49 |      ll x=q.front.second;
      |           ~~^~~~~
a.cc:57:18: error: unable to find numeric literal operator 'operator""x'
   57 |          if(in(y+4x[i],x+4x[i+1]&&!vis[y+4x[i]][x+4x[i+1]])){
      |                  ^~
a.cc:57:26: error: unable to find numeric literal operator 'operator""x'
   57 |          if(in(y+4x[i],x+4x[i+1]&&!vis[y+4x[i]][x+4x[i+1]])){
      |                          ^~
a.cc:57:42: error: unable to find numeric literal operator 'operator""x'
   57 |          if(in(y+4x[i],x+4x[i+1]&&!vis[y+4x[i]][x+4x[i+1]])){
      |                                          ^~
a.cc:57:51: error: unable to find numeric literal operator 'operator""x'
   57 |          if(in(y+4x[i],x+4x[i+1]&&!vis[y+4x[i]][x+4x[i+1]])){
      |                                                   ^~
a.cc:58:20: error: unable to find numeric literal operator 'operator""x'
   58 |              vis[y+4x[i]][x+4x[i+1]]=1;
      |                    ^~
a.cc:58:29: error: unable to find numeric literal operator 'operator""x'
   58 |              vis[y+4x[i]][x+4x[i+1]]=1;
      |                             ^~
a.cc:7:15: error: 'class std::queue<std::pair<long long int, long long int> >' has no member named 'push_back'
    7 | #define pb(a) push_back((a))
      |               ^~~~~~~~~
a.cc:59:16: note: in expansion of macro 'pb'
   59 |              q.pb(P(y+4x[i],x+4x[i+1]));
      |                ^~
a.cc:59:23: error: unable to find numeric literal operator 'operator""x'
   59 |              q.pb(P(y+4x[i],x+4x[i+1]));
      |                       ^~
a.cc:7:26: note: in definition of macro 'pb'
    7 | #define pb(a) push_back((a))
      |                          ^
a.cc:59:31: error: unable to find numeric literal operator 'operator""x'
   59 |              q.pb(P(y+4x[i],x+4x[i+1]));
      |                               ^~
a.cc:7:26: note: in definition of macro 'pb'
    7 | #define pb(a) push_back((a))
      |                          ^
a.cc:60:21: error: unable to find numeric literal operator 'operator""x'
   60 |              road[y+4x[i]][x+4x[i+1]]=P(y,x);
      |                     ^~
a.cc:60:30: error: unable to find numeric literal operator 'operator""x'
   60 |              road[y+4x[i]][x+4x[i+1]]=P(y,x);
      |                              ^~