Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<stdio.h>
#include<vector>
using namespace std;
#define int long long
#define rep(s,i,n) for(int i=s;i<n;i++)
#define c(n) cout<<n<<endl;
#define ic(n) int n;cin>>n;
#define sc(s) string s;cin>>s;
#define mod 1000000007
#define inf 1000000000000000007
#define f first
#define s second
#define mini(c,a,b) *min_element(c+a,c+b)
#define maxi(c,a,b) *max_element(c+a,c+b)
#define P pair<int,int>
//printf("%.12Lf\n",);
int keta(int x){
	rep(0,i,30){
		if(x<10){
			return i+1;
		}
		x=x/10;
	}
}
int gcd(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return bb;
		}	
		bb=bb%aa;
		if(bb==0){
			return aa;
		}
	}
}	
int lcm(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return x/bb*y;
		}	
		bb=bb%aa;
		if(bb==0){
			return x/aa*y;
		}
	}
}
bool p(int x){
	if(x==1)return false;
	rep(2,i,sqrt(x)+1){
		if(x%i==0&&x!=i){
			return false;
		}
	}	
	return true;
}
int max(int a,int b){
	if(a>=b)return a;
	else return b;
}
int min(int a,int b){
	if(a>=b)return b;
	else return a;
}	
int n2[41];		
int nis[41]; 
int nia[41];
int mody[41];
int nn;
int com(int n,int y){
	int ni=1;
	for(int i=0;i<41;i++){
		n2[i]=ni;
		ni*=2;
	}
	int bunsi=1,bunbo=1;
	rep(0,i,y)bunsi=(bunsi*(n-i))%mod;
	rep(0,i,y)bunbo=(bunbo*(i+1))%mod;
	mody[0]=bunbo;
	rep(1,i,41){
		bunbo=(bunbo*bunbo)%mod;
		mody[i]=bunbo;
	}
	rep(0,i,41)nis[i]=0;
	nn=mod-2;
	for(int i=40;i>=0;i-=1){
		if(nn>n2[i]){
			nis[i]++;
			nn-=n2[i];
		}
	}
	nis[0]++;
	rep(0,i,41){
		if(nis[i]==1){
			bunsi=(bunsi*mody[i])%mod;
		}
	}
	return bunsi;
}
int yakuwa(int n){
	int sum=0;
	rep(1,i,sqrt(n+1)){
		if(n%i==0)sum+=i+n/i;
		if(i*i==n)sum-=i;
	}
	return sum;
}	
bool hei(int n){
	rep(0,i,100){
		if(i*i==n){
			return true;
		}
	}
	return false;
}
int pow(int b,int a){	
	int aa=1;
	rep(0,i,a)aa*=b;	
	return aa;
}
int sankaku(int a){
	return a*(a+1)/2;
}
int a[4]={0,1,0,-1};
int b[4]={1,0,-1,0};
int d[114][114];
char c[114][114];
signed main(){
	ic(h) ic(w)
	rep(0,i,h)rep(0,j,w)cin>>c[i][j];
	queue<P>que;
	rep(0,i,h)rep(0,j,w)d[i][j]=inf;
	d[0][0]=0;
	que.push(P(0,0));
	while(que.size()){
		P p=que.front(); que.pop();
		if(p.first==h-1&&p.second==w-1)break;
		rep(0,i,4){
			int ny=p.first+a[i],nx=p.second+b[i];
			if(0<=ny&&ny<h&&0<=nx&&nx<w&&d[ny][nx]==inf&&c[ny][nx]!='#'){
				que.push(P(ny,nx));
				d[ny][nx]=d[p.first][p.second]+1;
			}
		}
	}
	int ans=0;
	rep(0,i,h)rep(0,j,w)if(c[i][j]!='#')ans++;
	c(ans-d[h-1][w-1]-1)
}			

Compiler output:
a.cc: In function 'int main()':
a.cc:138:9: error: 'queue' was not declared in this scope
  138 |         queue<P>que;
      |         ^~~~~
a.cc:7:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    6 | #include<vector>
  +++ |+#include <queue>
    7 | using namespace std;
a.cc:138:16: error: expected primary-expression before '>' token
  138 |         queue<P>que;
      |                ^
a.cc:138:17: error: 'que' was not declared in this scope
  138 |         queue<P>que;
      |                 ^~~
a.cc: In function 'long long int keta(long long int)':
a.cc:28:1: warning: control reaches end of non-void function [-Wreturn-type]
   28 | }
      | ^
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:41:1: warning: control reaches end of non-void function [-Wreturn-type]
   41 | }
      | ^
a.cc: In function 'long long int lcm(long long int, long long int)':
a.cc:54:1: warning: control reaches end of non-void function [-Wreturn-type]
   54 | }
      | ^