結果
問題 | No.1870 Xor Matrix |
ユーザー |
|
提出日時 | 2021-12-10 23:13:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 97 ms / 2,000 ms |
コード長 | 468 bytes |
コンパイル時間 | 1,835 ms |
コンパイル使用メモリ | 192,472 KB |
最終ジャッジ日時 | 2025-01-26 07:32:06 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 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, 20 * (N - 1) * (M - 1)) << endl;}