-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB.cpp
More file actions
30 lines (29 loc) · 651 Bytes
/
Copy pathB.cpp
File metadata and controls
30 lines (29 loc) · 651 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <bits/stdc++.h>
#define fore(i, a, b) for(long i = (a), asdf = (b); i < asdf; i++)
#define ENDL '\n'
using namespace std;
typedef long long lli;
const lli N = 2e3 + 5;
const lli MOD = 998244353ll;
int main() {
lli h, w; cin >> h >> w;
vector<char> v(h + w - 1, '.');
fore(i, 0, h){
fore(j, 0, w){
char x; cin >> x;
if(x != '.'){
if(v[i + j] == '.') v[i + j] = x;
else if(v[i + j] != x){
cout << 0 << ENDL;
return 0;
}
}
}
}
lli res = 1;
for(auto i : v){
if(i == '.') res = res * 2ll % MOD;
}
cout << res << ENDL;
return 0;
}