Language: C++


//#include <bits/stdc++.h>
//#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>
#include <numeric>
#include <iomanip>
using namespace std;
using ll=long long;

#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007

constexpr ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
constexpr ll lcm(ll a,ll b){return a*b/gcd(a,b);}
constexpr ll abs(ll a,ll b){
if(a>=b)return a-b;
if(a<b)return b-a;
}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main() {
typedef pair<int, int> P;
int H,W;
int ans=0;
int load=0;
cin >> H>>W;
char s[H][W];
int d[H][W];

queue<int,int> que;

FOR(i,0,H-1){
FOR(j,0,W-1){
  cin >> s[i][j];
  d[i][j]=-1;
  if(s[i][j]=='.'){load++;}
}
}
que.push(P(0,0));
d[0][0]=0;

while(que.size()){
  P p=que.front;que.pop;
  if(p.first==H-1&&p.second==W-1){break;}

FOR(i,0,3){
int nx=p.first+dx[i];
int ny=p.second+dy[i];

//if(d[nx][ny] == -1 && nx>=0 && ny=0 && nx<H && ny<W && s[nx][ny]=='.')
//  que.push(P(nx,ny));
//  d[nx][ny]==d[p.first][p.second]+1;
//}
}


cout<<ans<<endl;
  return 0;
}


Compiler output:
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:10:
/usr/include/c++/14/bits/stl_queue.h: In instantiation of 'class std::queue<int, int>':
a.cc:50:16:   required from here
   50 | queue<int,int> que;
      |                ^~~
/usr/include/c++/14/bits/stl_queue.h:132:67: error: 'int' is not a class, struct, or union type
  132 |       static_assert(is_same<_Tp, typename _Sequence::value_type>::value,
      |                                                                   ^~~~~
/usr/include/c++/14/bits/stl_queue.h:138:57: error: 'int' is not a class, struct, or union type
  138 |       typedef typename  _Sequence::value_type           value_type;
      |                                                         ^~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:139:57: error: 'int' is not a class, struct, or union type
  139 |       typedef typename  _Sequence::reference            reference;
      |                                                         ^~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:140:57: error: 'int' is not a class, struct, or union type
  140 |       typedef typename  _Sequence::const_reference      const_reference;
      |                                                         ^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:141:57: error: 'int' is not a class, struct, or union type
  141 |       typedef typename  _Sequence::size_type            size_type;
      |                                                         ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:59:5: error: 'class std::queue<int, int>' has no member named 'push'
   59 | que.push(P(0,0));
      |     ^~~~
a.cc:62:11: error: 'class std::queue<int, int>' has no member named 'size'
   62 | while(que.size()){
      |           ^~~~
a.cc:63:11: error: 'class std::queue<int, int>' has no member named 'front'
   63 |   P p=que.front;que.pop;
      |           ^~~~~
a.cc:63:21: error: invalid use of non-static member function 'void std::queue<_Tp, _Sequence>::pop() [with _Tp = int; _Sequence = int]'
   63 |   P p=que.front;que.pop;
      |                 ~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:316:7: note: declared here
  316 |       pop()
      |       ^~~
a.cc:79:2: error: expected '}' at end of input
   79 | }
      |  ^
a.cc:41:12: note: to match this '{'
   41 | int main() {
      |            ^