結果
問題 |
No.1870 Xor Matrix
|
ユーザー |
![]() |
提出日時 | 2022-03-11 21:58:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 730 bytes |
コンパイル時間 | 783 ms |
コンパイル使用メモリ | 67,328 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-16 02:11:51 |
合計ジャッジ時間 | 2,854 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 WA * 8 |
ソースコード
#include <iostream> #include <vector> using namespace std; typedef long long ll; const ll MOD = 998244353; long long modpow(long long x, long long n){ long long res = 1; long long mul = x; while(n){ if(n % 2) res = res * mul % MOD; mul = mul * mul % MOD; n /= 2; } return res; } int main() { int n, m; cin >> n >> m; int c[22]{0}; for(int i = 0; i < n + m; i++){ int a; cin >> a; for(int j = 0; j < 20; j++){ c[j] += (a >> j) & 1; } } bool f = true; for(int j = 0; j < 20; j++){ if(c[j] % 2) f = false; } if(!f) cout << 0 << endl; else cout << modpow(modpow(2, (n - 1) * (m - 1)), 20) << endl; }