Language: C++

#include <iostream>
using namespace std;
char field[1000][1000];
int score[1000][1000];
bool success[1000][1000];

int score(int x, int  y, int a, int b){
    if(field[x+1][y] == "." ){
        if(x == a){
            score[x+1][y] -= 10000;
        }
        score[x+1][y] += 101-y-x; 
    }
    if(field[x][y+1] == "." && ){
        if(x == a){
            score[x][y+1] -= 10000;
        }
        score[x][y+1] += 101-y-x;
    }
    else{
        score[x+1][y] += score(x+1, y);
        score[x][y+1] += score(x, y+1); 
    }
    if(score[x+1][y]>=score[x][y+1]){
        success[x+1][y] = ture;
        return 0;
    }
    else if(score[x][y+1]>score[x+1][y]){
        success[x][y+1] = ture;
        return 0;
    }
}

int main(){
    int h, w;
    int answer = 0;
    cin >> h >> w;
    for(int i=1;i<=h;i++){
        for(int j=1;j<=w;j++){
            cin>>field[i][j];
            score[i][j] = 0;
        }
    }
    if(field[1][1]=="#"){
        field[1][1] = ".";
        answer += 1;
    }
    int a=1;
    int b=1;
    while(a<=w && b<=h){
        if(a == w && b == h){
            break;
        }
        if(success[a+1][b]==true){
            field[a+1][b]=".";
            a = a+1;
            answer += 1;
        }
        else if(success[a][b+1]==true){
            field[a][b+1]=".";
            b = b+1;
            answer += 1;
        }
    }
    for(int i=1;i<=h;i++){
        for(int j=1;j<=w;j++){
            cout << field[i][j];
        }
        cout << endl;
    }
    return 0;
}

Compiler output:
a.cc:7:38: error: 'int score(int, int, int, int)' redeclared as different kind of entity
    7 | int score(int x, int  y, int a, int b){
      |                                      ^
a.cc:4:5: note: previous declaration 'int score [1000][1000]'
    4 | int score[1000][1000];
      |     ^~~~~
a.cc: In function 'int score(int, int, int, int)':
a.cc:8:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     if(field[x+1][y] == "." ){
      |        ~~~~~~~~~~~~~~^~~~~~
a.cc:14:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(field[x][y+1] == "." && ){
      |        ~~~~~~~~~~~~~~^~~~~~
a.cc:14:32: error: expected primary-expression before ')' token
   14 |     if(field[x][y+1] == "." && ){
      |                                ^
a.cc:21:31: error: 'score' cannot be used as a function
   21 |         score[x+1][y] += score(x+1, y);
      |                          ~~~~~^~~~~~~~
a.cc:22:31: error: 'score' cannot be used as a function
   22 |         score[x][y+1] += score(x, y+1);
      |                          ~~~~~^~~~~~~~
a.cc:25:27: error: 'ture' was not declared in this scope
   25 |         success[x+1][y] = ture;
      |                           ^~~~
a.cc:29:27: error: 'ture' was not declared in this scope
   29 |         success[x][y+1] = ture;
      |                           ^~~~
a.cc: In function 'int main()':
a.cc:44:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   44 |     if(field[1][1]=="#"){
      |        ~~~~~~~~~~~^~~~~
a.cc:45:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   45 |         field[1][1] = ".";
      |                       ^~~
      |                       |
      |                       const char*
a.cc:55:27: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   55 |             field[a+1][b]=".";
      |                           ^~~
      |                           |
      |                           const char*
a.cc:60:27: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   60 |             field[a][b+1]=".";
      |                           ^~~
      |                           |
      |                           const char*
a.cc: In function 'int score(int, int, int, int)':
a.cc:32:1: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      | ^