Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
using Graph=vector<vector<int>>;
using edge= struct{int to;ll cost;};


template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
using Graph =vector<vector<int>>;
//xor ^

int data[100][100];
int ans=10000;
int high=0;
int width=0;
int dfs(int now_x,int now_y,int color,int min){
  if(ans<=min){
    return 0;
  }
  if(ans==0){
    return 0;
  }
  int tmp=data[now_x][now_y];
    if(color==0&&tmp==1){
      min++;
    }
    if(now_x<high-1&&now_y<width-1){
      dfs(now_x,now_y+1,tmp,min);
      dfs(now_x+1,now_y,tmp,min);
    }else if(now_x==high-1&&now_y<width-1){
      dfs(now_x,now_y+1,tmp,min);
    }else if(now_x<high-1&&now_y==width-1){
      dfs(now_x+1,now_y,tmp,min);
    }else{
      if(min<ans){
        ans=min;
      }
    }
  return 0;
}
int main(){
  cin>>high>>width;
  REP(i,H){
    REP(j,W){
      char tmp;cin>>tmp;
      if(tmp=='#'){
        data[i][j]=1;
      }else{
        data[i][j]=0;
      }
    }
  }
  dfs(0,0,0,0);
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int dfs(int, int, int, int)':
a.cc:54:11: error: reference to 'data' is ambiguous
   54 |   int tmp=data[now_x][now_y];
      |           ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:43:5: note:                 'int data [100][100]'
   43 | int data[100][100];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:74:9: error: 'H' was not declared in this scope
   74 |   REP(i,H){
      |         ^
a.cc:20:33: note: in definition of macro 'REP'
   20 | #define REP(i,n) for(int i=0; i<n; ++i)
      |                                 ^
a.cc:75:11: error: 'W' was not declared in this scope
   75 |     REP(j,W){
      |           ^
a.cc:20:33: note: in definition of macro 'REP'
   20 | #define REP(i,n) for(int i=0; i<n; ++i)
      |                                 ^
a.cc:78:9: error: reference to 'data' is ambiguous
   78 |         data[i][j]=1;
      |         ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:43:5: note:                 'int data [100][100]'
   43 | int data[100][100];
      |     ^~~~
a.cc:80:9: error: reference to 'data' is ambiguous
   80 |         data[i][j]=0;
      |         ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:43:5: note:                 'int data [100][100]'
   43 | int data[100][100];
      |     ^~~~