問題一覧 > 通常問題

No.1870 Xor Matrix

レベル : / AI推定難易度 : 1125 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 113
作問者 : ytqm3 / テスター : ぷら shiomusubi496
お気に入りにしたユーザー ProblemId : 7089 / 自分の提出
問題文最終更新日: 2022-03-11 15:02:25
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 335 (順位表) の他の問題:

Problem Statement

Find the number, modulo $998244353$, of $N \times M$ integer matrices $C$ satisfying the following conditions.

  • $0 \le C_{i,j} < 2^{20}$
  • For all $i$, $C_{i,1} \oplus C_{i,2} \oplus \ldots \oplus C_{i,M} = A_i$
  • For all $j$, $C_{1,j} \oplus C_{2,j} \oplus \ldots \oplus C_{N,j} = B_j$

Here, $a \oplus b$ denotes the $\mathrm{bit}$wise exclusive OR of $a$ and $b$.

Input

$N$ $M$
$A_1$ $A_2$ $\ldots$ $A_N$
$B_1$ $B_2$ $\ldots$ $B_M$
  • All inputs are integers
  • $1 \le N,M \le 2 \times 10^5$
  • $0 \le A_i, B_j < 2^{20}$

Output

Output the answer.

Sample

Sample 1
Input
2 1
13 6
11
Output
1

$C_{1,1} = 13, C_{2,1} = 6$ satisfies the conditions.

Sample 2
Input
2 3
1270 1791
1622 1392 1245
Output
0

No $C$ satisfies the conditions.

Sample 3
Input
6 7
15380 13056 13358 15575 12238 9049
23090 27403 16315 26000 2895 32475 5628
Output
789997404

Do not forget to find the remainder modulo $998244353$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。