結果
問題 |
No.3071 Double Speedrun
|
ユーザー |
|
提出日時 | 2025-03-21 23:39:05 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 159 ms / 6,000 ms |
コード長 | 829 bytes |
コンパイル時間 | 4,512 ms |
コンパイル使用メモリ | 251,680 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-21 23:39:11 |
合計ジャッジ時間 | 6,513 ms |
ジャッジサーバーID (参考情報) |
judge7 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using mint = atcoder::modint998244353; int main(){ ios::sync_with_stdio(false); cin.tie(0); int h, w; cin >> h >> w; string str; array<array<mint,400>,400> dp; dp[0][1] = 1; for(int y = 0; y < h; y++){ cin >> str; for(int x2 = 0; x2 < w; x2++){ for(int x1 = 0; x1 < x2; x1++){ if(str[x1] == '#' || str[x2] == '#') dp[x1][x2] = 0; if(x1 + 1 < x2 && str[x1 + 1] == '.') dp[x1 + 1][x2] += dp[x1][x2]; } } for(int x1 = 0; x1 < w; x1++){ for(int x2 = x1 + 1; x2 < w; x2++){ if(x2 + 1 < w && str[x2 + 1] == '.') dp[x1][x2 + 1] += dp[x1][x2]; } } } cout << dp[w - 2][w - 1].val() << '\n'; }