結果
問題 |
No.1870 Xor Matrix
|
ユーザー |
|
提出日時 | 2021-12-10 23:11:14 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 463 bytes |
コンパイル時間 | 1,719 ms |
コンパイル使用メモリ | 193,212 KB |
最終ジャッジ日時 | 2025-01-26 07:31:46 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 10 WA * 10 |
ソースコード
#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; }