Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <cstring>
#define M 1e3+10

using namespace std;

char mp[M][M];
int step[M][M];
bool visit[M][M];
int direct[4][2]={{-1,0},{1,0},{0,1},{0,-1}};

bool check(int tempx,int tempy,int height,int width)
{
    if(tempx<0 || tempy<0 || tempx>height || tempy>width || visit[tempx][tempy] || mp[tempx][tempy] == '#')
    {
        return false;
    }
    return true;
}

int bfs(int height, int width)
{
    queue<pair<int, int> > open;
    open.push(make_pair(0,0));
    step[0][0] = 1;
    visit[0][0] = true;
    while(!open.empty())
    {
        pair<int, int> temp = open.front();
        open.pop();
        for(int i=0; i<4; i++)
        {
            int tempx = temp.first + direct[i][0];
            int tempy = temp.second + direct[i][1];
            if(tempx == height-1 && tempy == width-1)
            {
                return step[temp.first][temp.second] + 1;
            }
            else if(check(tempx,tempy,height,width))
            {
                visit[tempx][tempy] = true;
                step[tempx][tempy] = step[temp.first][temp.second] + 1;
                open.push(make_pair(tempx,tempy));
            }
        }
    }
    return -1;
}

int main()
{
    int height, width;
    scanf("%d %d",&height,&width);
    int blacksum = 0;
    for(int i=0; i<height; i++)
    {
        for(int j=0; j<width; j++)
        {
            scanf(" %c",&mp[i][j]);
            if(mp[i][j]=='#')
            {
                blacksum++;
            }
        }
    }
    int minline = bfs(height,width);
    if(minline == -1)
    {
        printf("-1\n");
    }
    else
    {
        printf("%d\n",height*width-blacksum-minline);
    }
    return 0;
}

Compiler output:
a.cc:6:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    6 | #define M 1e3+10
      |           ~~~^~~
a.cc:10:12: note: in expansion of macro 'M'
   10 | char mp[M][M];
      |            ^
a.cc:6:14: error: could not convert '(1.0e+3 + (double)10)' from 'double' to 'long unsigned int'
    6 | #define M 1e3+10
      |           ~~~^~~
      |              |
      |              double
a.cc:10:12: note: in expansion of macro 'M'
   10 | char mp[M][M];
      |            ^
a.cc:6:14: error: size of array 'mp' has non-integral type 'double'
    6 | #define M 1e3+10
      |           ~~~^~~
a.cc:10:12: note: in expansion of macro 'M'
   10 | char mp[M][M];
      |            ^
a.cc:6:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    6 | #define M 1e3+10
      |           ~~~^~~
a.cc:10:9: note: in expansion of macro 'M'
   10 | char mp[M][M];
      |         ^
a.cc:6:14: error: could not convert '(1.0e+3 + (double)10)' from 'double' to 'long unsigned int'
    6 | #define M 1e3+10
      |           ~~~^~~
      |              |
      |              double
a.cc:10:9: note: in expansion of macro 'M'
   10 | char mp[M][M];
      |         ^
a.cc:6:14: error: size of array 'mp' has non-integral type 'double'
    6 | #define M 1e3+10
      |           ~~~^~~
a.cc:10:9: note: in expansion of macro 'M'
   10 | char mp[M][M];
      |         ^
a.cc:6:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    6 | #define M 1e3+10
      |           ~~~^~~
a.cc:11:13: note: in expansion of macro 'M'
   11 | int step[M][M];
      |             ^
a.cc:6:14: error: could not convert '(1.0e+3 + (double)10)' from 'double' to 'long unsigned int'
    6 | #define M 1e3+10
      |           ~~~^~~
      |              |
      |              double
a.cc:11:13: note: in expansion of macro 'M'
   11 | int step[M][M];
      |             ^
a.cc:6:14: error: size of array 'step' has non-integral type 'double'
    6 | #define M 1e3+10
      |           ~~~^~~
a.cc:11:13: note: in expansion of macro 'M'
   11 | int step[M][M];
      |             ^
a.cc:6:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    6 | #define M 1e3+10
      |           ~~~^~~
a.cc:11:10: note: in expansion of macro 'M'
   11 | int step[M][M];
      |          ^
a.cc:6:14: error: could not convert '(1.0e+3 + (double)10)' from 'double' to 'long unsigned int'
    6 | #define M 1e3+10
      |           ~~~^~~
      |              |
      |              double
a.cc:11:10: note: in expansion of macro 'M'
   11 | int step[M][M];
      |          ^
a.cc:6:14: error: size of array 'step' has non-integral type 'double'
    6 | #define M 1e3+10
      |           ~~~^~~
a.cc:11:10: note: in expansion of macro 'M'
   11 | int step[M][M];
      |          ^
a.cc:6:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    6 | #define M 1e3+10
      |           ~~~^~~
a.cc:12:15: note: in expansion of macro 'M'
   12 | bool visit[M][M];
      |               ^
a.cc:6:14: error: could not convert '(1.0e+3 + (double)10)' from 'double' to 'long unsigned int'
    6 | #define M 1e3+10
      |           ~~~^~~
      |              |
      |              double
a.cc:12:15: note: in expansion of macro 'M'
   12 | bool visit[M][M];
      |               ^
a.cc:6:14: error: size of array 'visit' has non-integral type 'double'
    6 | #define M 1e3+10
      |           ~~~^~~
a.cc:12:15: note: in expansion of macro 'M'
   12 | bool visit[M][M];
      |               ^
a.cc:6:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    6 | #define M 1e3+10
      |           ~~~^~~
a.cc:12:12: note: in expansion of macro 'M'
   12 | bool visit[M][M];
      |            ^
a.cc:6:14: error: could not convert '(1.0e+3 + (double)10)' from 'double' to 'long unsigned int'
    6 | #define M 1e3+10
      |           ~~~^~~
      |              |
      |              double
a.cc:12:12: note: in expansion of macro 'M'
   12 | bool visit[M][M];
      |            ^
a.cc:6:14: error: size of array 'visit' has non-integral type 'double'
    6 | #define M 1e3+10
      |           ~~~^~~
a.cc:12:12: note: in expansion of macro 'M'
   12 | bool visit[M][M];
      |            ^