結果

問題 No.803 Very Limited Xor Subset
ユーザー mkawa2mkawa2
提出日時 2023-03-10 16:47:12
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 1,248 bytes
コンパイル時間 893 ms
コンパイル使用メモリ 81,652 KB
実行使用メモリ 64,428 KB
最終ジャッジ日時 2023-10-18 06:45:22
合計ジャッジ時間 5,786 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,392 KB
testcase_01 AC 37 ms
53,392 KB
testcase_02 AC 37 ms
53,392 KB
testcase_03 AC 37 ms
53,392 KB
testcase_04 AC 37 ms
53,392 KB
testcase_05 AC 38 ms
53,392 KB
testcase_06 AC 38 ms
53,392 KB
testcase_07 AC 39 ms
53,392 KB
testcase_08 AC 38 ms
53,392 KB
testcase_09 AC 38 ms
53,392 KB
testcase_10 AC 38 ms
53,392 KB
testcase_11 AC 39 ms
53,392 KB
testcase_12 AC 40 ms
53,392 KB
testcase_13 AC 38 ms
53,392 KB
testcase_14 AC 49 ms
64,272 KB
testcase_15 AC 51 ms
64,296 KB
testcase_16 AC 49 ms
64,280 KB
testcase_17 AC 53 ms
64,400 KB
testcase_18 AC 49 ms
64,288 KB
testcase_19 AC 49 ms
64,288 KB
testcase_20 AC 49 ms
64,288 KB
testcase_21 AC 51 ms
64,396 KB
testcase_22 AC 49 ms
64,288 KB
testcase_23 AC 50 ms
64,416 KB
testcase_24 AC 53 ms
64,428 KB
testcase_25 AC 52 ms
64,360 KB
testcase_26 AC 50 ms
64,416 KB
testcase_27 AC 50 ms
64,416 KB
testcase_28 AC 50 ms
64,348 KB
testcase_29 AC 50 ms
64,416 KB
testcase_30 AC 51 ms
64,424 KB
testcase_31 AC 50 ms
64,348 KB
testcase_32 AC 50 ms
64,348 KB
testcase_33 AC 50 ms
64,416 KB
testcase_34 AC 45 ms
62,044 KB
testcase_35 AC 48 ms
64,156 KB
testcase_36 AC 47 ms
62,044 KB
testcase_37 AC 47 ms
62,044 KB
testcase_38 AC 44 ms
59,764 KB
testcase_39 AC 46 ms
61,832 KB
testcase_40 AC 50 ms
64,340 KB
testcase_41 AC 51 ms
64,340 KB
testcase_42 AC 50 ms
64,340 KB
testcase_43 AC 46 ms
62,148 KB
testcase_44 AC 38 ms
53,408 KB
testcase_45 AC 38 ms
53,408 KB
testcase_46 AC 43 ms
59,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# inf = (1 << 31)-1
md = 10**9+7
# md = 998244353

n, m, x = LI()
aa = LI()
lr = LLI(m)

ss = [0]*(30+m)
for a in aa+[x]:
    for i in range(30):
        ss[i] <<= 1
        ss[i] |= a & 1
        a >>= 1

for i, (t, l, r) in enumerate(lr, 30):
    l -= 1
    ss[i] = (1 << r-l)-1 << n-r+1
    ss[i] |= t

btos = {}

for s in ss:
    if len(btos) == 30+m: break
    while s:
        b = s.bit_length()
        if b in btos:
            s ^= btos[b]
        else:
            btos[b] = s
            break

if 1 in btos:
    print(0)
else:
    print(pow(2, n-len(btos), md))
0