結果
問題 |
No.2838 Diagonals
|
ユーザー |
|
提出日時 | 2024-08-09 22:43:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 506 bytes |
コンパイル時間 | 3,476 ms |
コンパイル使用メモリ | 250,944 KB |
最終ジャッジ日時 | 2025-02-23 21:55:13 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 2 WA * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using mint = modint998244353; int main () { int H, W; cin >> H >> W; mint ans = 1; char A[555][555]; for (int i = 0; i <= H; i ++) { for (int j = 0; j <= W; j ++) { if (min(i, j) == 0) { A[i][j] = '.'; } else { cin >> A[i][j]; if (A[i][j] == '#') { ans *= 2; if (A[i][j - 1] == '.' && A[i - 1][j] == '.') { ans *= 2; } } } } } cout << ans.val() << endl; }