結果
問題 |
No.1870 Xor Matrix
|
ユーザー |
|
提出日時 | 2021-12-10 23:10:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 463 bytes |
コンパイル時間 | 1,734 ms |
コンパイル使用メモリ | 191,708 KB |
最終ジャッジ日時 | 2025-01-26 07:31:36 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll mod = 998244353; ll mod_pow(ll a, ll b) { if (!b) return 1; if (b & 1) return mod_pow(a, b - 1) * a % mod; return mod_pow(a * a % mod, b >> 1); } int main() { ll N, M; cin >> N >> M; ll x = 0; for (int i = 0; i < N + M; ++i) { ll a; cin >> a; x ^= a; } if (x == 0) puts("0"); else cout << mod_pow(2, (N - 1) * (M - 1)) << endl; }