Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <list>
#include <utility>
#include <algorithm>
#include <cmath>

using namespace std;

using ll = long long;
using str = string;
using vec = vector;
using vl = vec<ll>;
using vs = vec<str>;
using listl = list<ll>;

#define min(A, B) min(static_cast<ll>(A), static_cast<ll>(B))
#define max(A, B) max(static_cast<ll>(A), static_cast<ll>(B))
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pb push_back

#define rep(i, m)		for(ll i = 0, i_max = m; i < i_max; i++)
#define erep(i, m)		for(ll i = 0, i_max = m; i <= i_max; i++)
#define nrep(i, b, m)	for(ll i = b, i_max = m; i < i_max; i++)
#define enrep(i, b, m)	for(ll i = b, i_max = m; i <= i_max; i++)
#define brep(i, m)		for(ll i = m; i >= 0; i--)
#define ebrep(i, b, e)	for(ll i = b; i >= e; i--)

#define _rep(m)			rep(i, m)
#define _erep(m)		erep(i, m)
#define _nrep(b, m)		nrep(i, b, m)
#define _enrep(b, m)	enrep(i, b, m)
#define _brep(m)		brep(i, m)
#define _ebrep(b, e)	ebrep(i, b, e)

// modint: mod 計算を int を扱うように扱える構造体
template<int MOD> struct Fp {
	ll val;
	constexpr Fp(ll v = 0) noexcept : val(v % MOD) {
		if (val < 0) val += MOD;
	}
	constexpr int getmod() { return MOD; }
	constexpr Fp operator - () const noexcept {
		return val ? MOD - val : 0;
	}
	constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
	constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
	constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
	constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
	constexpr Fp& operator += (const Fp& r) noexcept {
		val += r.val;
		if (val >= MOD) val -= MOD;
		return *this;
	}
	constexpr Fp& operator -= (const Fp& r) noexcept {
		val -= r.val;
		if (val < 0) val += MOD;
		return *this;
	}
	constexpr Fp& operator *= (const Fp& r) noexcept {
		val = val * r.val % MOD;
		return *this;
	}
	constexpr Fp& operator /= (const Fp& r) noexcept {
		ll a = r.val, b = MOD, u = 1, v = 0;
		while (b) {
			ll t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		val = val * u % MOD;
		if (val < 0) val += MOD;
		return *this;
	}
	constexpr bool operator == (const Fp& r) const noexcept {
		return this->val == r.val;
	}
	constexpr bool operator != (const Fp& r) const noexcept {
		return this->val != r.val;
	}
	friend ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
		return os << x.val;
	}
	friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, ll n) noexcept {
		if (n == 0) return 1;
		auto t = modpow(a, n / 2);
		t = t * t;
		if (n & 1) t = t * a;
		return t;
	}
};

const int MOD = 1000000007;
using mint = Fp<MOD>;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }

void in(ll& I)
{
	cin >> I;
}

void in(vl& I)
{
	for (auto& i : I)
	{
		cin >> i;
	}
}

void in(vs& I)
{
	for (auto& i : I)
	{
		cin >> i;
	}
}

void in(listl& I)
{
	for (auto& i : I)
	{
		cin >> i;
	}
}

void in(str& s)
{
	cin >> s;
}

void out(ll O)
{
	cout << O;
}

void out(vl& O)
{
	for (auto& o : O)
	{
		cout << o << endl;
	}
}

void rout(bool b, str True, str False)
{
	if (b) cout << True.c_str();
	else cout << False.c_str();
}

const ll INF = 1LL<<60;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

ll dp[1010][1010];

ll res(ll n)
{
    if(dp[n]>=0)return dp[n];
    
    ll ans=0;
    for(auto ny:G[n])
    {
        chmax(ans,res(ny)+1);
    }
    
    return dp[n]=ans;
}

int main()
{
    ll H,W;
    cin>>H>>W;
    
    vec<str> G(H);
    rep(i,H)cin>>G[i];
    
    dp[1][1]=1;
    
    nrep(h,1,H) nrep(w,1,W)
    {
        if(G[h-1][w-1]=='#')dp[h][w]=0;
        chmax(dp[h][w],dp[h-1][w]+dp[h][w]);
        dp[h][w]%=MOD;
    }
    
    cout<<dp[H][W];

	return 0;
}




Compiler output:
a.cc:13:13: error: missing template arguments after 'std::vector'
   13 | using vec = vector;
      |             ^~~~~~
      |                   <>
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note: 'template<class _Tp, class _Alloc> class std::vector' declared here
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:14:12: error: 'vec' does not name a type
   14 | using vl = vec<ll>;
      |            ^~~
a.cc:15:12: error: 'vec' does not name a type
   15 | using vs = vec<str>;
      |            ^~~
a.cc:106:6: error: variable or field 'in' declared void
  106 | void in(vl& I)
      |      ^~
a.cc:106:9: error: 'vl' was not declared in this scope; did you mean 'll'?
  106 | void in(vl& I)
      |         ^~
      |         ll
a.cc:106:13: error: 'I' was not declared in this scope
  106 | void in(vl& I)
      |             ^
a.cc:114:6: error: variable or field 'in' declared void
  114 | void in(vs& I)
      |      ^~
a.cc:114:9: error: 'vs' was not declared in this scope
  114 | void in(vs& I)
      |         ^~
a.cc:114:13: error: 'I' was not declared in this scope
  114 | void in(vs& I)
      |             ^
a.cc:140:6: error: variable or field 'out' declared void
  140 | void out(vl& O)
      |      ^~~
a.cc:140:10: error: 'vl' was not declared in this scope; did you mean 'll'?
  140 | void out(vl& O)
      |          ^~
      |          ll
a.cc:140:14: error: 'O' was not declared in this scope
  140 | void out(vl& O)
      |              ^
a.cc: In function 'll res(ll)':
a.cc:162:13: error: ordered comparison of pointer with integer zero ('ll*' {aka 'long long int*'} and 'int')
  162 |     if(dp[n]>=0)return dp[n];
      |        ~~~~~^~~
a.cc:162:28: error: invalid conversion from 'll*' {aka 'long long int*'} to 'll' {aka 'long long int'} [-fpermissive]
  162 |     if(dp[n]>=0)return dp[n];
      |                        ~~~~^
      |                            |
      |                            ll* {aka long long int*}
a.cc:165:17: error: 'G' was not declared in this scope
  165 |     for(auto ny:G[n])
      |                 ^
a.cc:170:17: error: incompatible types in assignment of 'll' {aka 'long long int'} to 'll [1010]' {aka 'long long int [1010]'}
  170 |     return dp[n]=ans;
      |            ~~~~~^~~~
a.cc: In function 'int main()':
a.cc:178:5: error: 'vec' was not declared in this scope
  178 |     vec<str> G(H);
      |     ^~~
a.cc:178:12: error: expected primary-expression before '>' token
  178 |     vec<str> G(H);
      |            ^
a.cc:178:14: error: 'G' was not declared in this scope
  178 |     vec<str> G(H);
      |              ^