问题 F: Educational Problem II
内存限制:512 MB
时间限制:4.000 S
评测方式:文本比较
命题人:
提交:1
解决:1
题目描述
You are given n, m, l, r and a matrix B = (bi,j )n×m.
Count the number of integer sequence a1, a2, . . . , an satisfying the following conditions, modulo
998 244 353:
• ∀i ∈ Z ∩ [1, n], l ≤ ai ≤ r.
• ∀i ∈ Z ∩ [1, n], ∃S ⊆ Z ∩ [1, m], ai =
L
j∈S
bi,j . That is, ai
is equal to the bitwise XOR sum of some
subsequence of (bi,1, bi,2, . . . , bi,m), and ai = 0 if the subsequence is empty.
• The number of i ∈ Z ∩ [2, n] that ai−1 6= ai
is minimized among all the sequences satisfying the
above two conditions.
输入
The first line contains four integers n, m, l, r (2 ≤ n ≤ 105
, 2 ≤ nm2 ≤ 4 × 107
, 0 ≤ l ≤ r < 2
m).
The i-th of the following n lines contains m integers bi,1, bi,2, . . . , bi,m (0 ≤ bi,j < 2
m).
Please note that l, r, bi,j are given in binary notation length of m.
输出
Output an integer representing the answer.
样例输入 复制
3 2 01 10
01 00
01 10
00 10
样例输出 复制
2