結果
問題 | No.1870 Xor Matrix |
ユーザー | shobonvip |
提出日時 | 2022-03-11 23:06:43 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 666 bytes |
コンパイル時間 | 454 ms |
コンパイル使用メモリ | 86,868 KB |
実行使用メモリ | 150,548 KB |
最終ジャッジ日時 | 2023-10-14 08:21:56 |
合計ジャッジ時間 | 8,019 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 62 ms
71,612 KB |
testcase_01 | AC | 62 ms
71,436 KB |
testcase_02 | AC | 61 ms
71,180 KB |
testcase_03 | AC | 287 ms
116,320 KB |
testcase_04 | WA | - |
testcase_05 | AC | 273 ms
115,568 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 347 ms
138,448 KB |
testcase_09 | WA | - |
testcase_10 | AC | 288 ms
124,360 KB |
testcase_11 | AC | 320 ms
138,268 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 208 ms
105,992 KB |
testcase_16 | AC | 242 ms
111,016 KB |
testcase_17 | WA | - |
testcase_18 | AC | 311 ms
128,544 KB |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | AC | 186 ms
99,556 KB |
testcase_22 | AC | 259 ms
115,864 KB |
ソースコード
n,m = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) mod = 998244353 ar = [[0 for i in range(20)] for j in range(n)] br = [[0 for i in range(20)] for j in range(m)] for i in range(n): for j in range(20): ar[i][j] = (a[i] >> j) & 1 for i in range(m): for j in range(20): br[i][j] = (b[i] >> j) & 1 ans = 1 for i in range(20): atmp = 0 btmp = 0 for j in range(n): atmp += ar[j][i] for j in range(m): btmp += br[j][i] #print(atmp, btmp, n-atmp, m-btmp) if atmp == 0 or btmp ==0 or n-atmp == 0 or m-btmp == 0: if atmp % 2 != btmp % 2: ans = 0 ans = ans * pow(2, n*m-n-m+1, mod) % mod print(ans)