Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define flash ios_base::sync_with_stdio(false); cin.tie(NULL)
#define rep(i, a, b) for(ll i = a; i < b; i++)
#define repc(i,a,b,c) for (ll i=a;(c>0?i<b:i>b) and c!=0;i+= c)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define all(name) (name.begin(), name.end())
#define fact(n) rep(i, 1, n+1)ft.pb((ft[i-1]*i)%mod);
#define mod_in(a) power(a, mod-2)
#define ncr(n, r) ((ft[n]*mod_in((ft[r]*ft[(n)-(r)])%mod))%mod)
#define deb(x) cout << #x << " " << x << endl;
const int INF=1e9;
int H, W; string S[101];
int dp[101][101];
int _main() {
    cin >> H >> W;
    for(ll y=0;y<H;y++) 
    cin >> S[y];

    for(ll y=0;y<H;y++) 
    {for(ll x=0;y<W;y++) dp[y][x]=INF;
    }
    dp[0][0] = 0;
    if (S[0][0] == '#') dp[0][0] = 1;

    for(ll y=0;y<H;y++) 
    {for(ll x=0;y<W;y++)
    {
        if (y + 1 < H) {
            if (S[y][x] == '.' && S[y + 1][x] == '#') min(dp[y + 1][x], dp[y][x] + 1);
            else min(dp[y + 1][x], dp[y][x]);
        }
        if (x + 1 < W) {
            if (S[y][x] == '.' && S[y][x + 1] == '#') min(dp[y][x + 1], dp[y][x] + 1);
            else min(dp[y][x + 1], dp[y][x]);
        }
    }
    }


    cout << dp[H - 1][W - 1] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int _main()':
a.cc:36:58: warning: ignoring return value of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]', declared with attribute 'nodiscard' [-Wunused-result]
   36 |             if (S[y][x] == '.' && S[y + 1][x] == '#') min(dp[y + 1][x], dp[y][x] + 1);
      |                                                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: declared here
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:37:21: warning: ignoring return value of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]', declared with attribute 'nodiscard' [-Wunused-result]
   37 |             else min(dp[y + 1][x], dp[y][x]);
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: declared here
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:40:58: warning: ignoring return value of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]', declared with attribute 'nodiscard' [-Wunused-result]
   40 |             if (S[y][x] == '.' && S[y][x + 1] == '#') min(dp[y][x + 1], dp[y][x] + 1);
      |                                                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: declared here
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:41:21: warning: ignoring return value of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]', declared with attribute 'nodiscard' [-Wunused-result]
   41 |             else min(dp[y][x + 1], dp[y][x]);
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: declared here
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status