結果
問題 | No.1870 Xor Matrix |
ユーザー |
👑 ![]() |
提出日時 | 2022-03-11 21:31:16 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 33 ms / 2,000 ms |
コード長 | 744 bytes |
コンパイル時間 | 613 ms |
コンパイル使用メモリ | 78,284 KB |
最終ジャッジ日時 | 2025-01-28 08:13:35 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>#include <atcoder/modint>using namespace std;using i64 = long long;using m32 = atcoder::static_modint<998244353>;#define rep(i,n) for(int i=0; i<(int)(n); i++)int main(){i64 N,M; cin >> N >> M;vector<int> A(N);rep(i,N) cin >> A[i];vector<int> B(M);rep(i,M) cin >> B[i];int allxor = 0;for(auto a : A) allxor ^= a;for(auto a : B) allxor ^= a;if(allxor != 0){ cout << "0\n"; return 0; }m32 ans = m32(1<<20).pow(N-1).pow(M-1);cout << ans.val() << endl;return 0;}struct ios_do_not_sync{ios_do_not_sync(){std::ios::sync_with_stdio(false);std::cin.tie(nullptr);}} ios_do_not_sync_instance;