結果
| 問題 |
No.2838 Diagonals
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-09 22:55:42 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 551 bytes |
| コンパイル時間 | 4,120 ms |
| コンパイル使用メモリ | 250,664 KB |
| 最終ジャッジ日時 | 2025-02-23 22:00:01 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 6 WA * 14 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
int main () {
int H, W;
cin >> H >> W;
assert(1 <= min(H, W) && max(H, W) <= 500);
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;
}