結果

問題 No.1456 Range Xor
ユーザー mkawa2mkawa2
提出日時 2021-03-31 21:28:19
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 897 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 10,912 KB
実行使用メモリ 21,400 KB
最終ジャッジ日時 2023-08-21 23:26:49
合計ジャッジ時間 4,083 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,728 KB
testcase_01 AC 16 ms
7,920 KB
testcase_02 AC 16 ms
7,860 KB
testcase_03 AC 47 ms
17,388 KB
testcase_04 AC 49 ms
17,528 KB
testcase_05 AC 58 ms
17,568 KB
testcase_06 AC 45 ms
17,568 KB
testcase_07 AC 58 ms
17,668 KB
testcase_08 AC 52 ms
17,504 KB
testcase_09 AC 46 ms
17,388 KB
testcase_10 AC 51 ms
17,464 KB
testcase_11 AC 24 ms
10,776 KB
testcase_12 AC 20 ms
9,508 KB
testcase_13 AC 31 ms
13,988 KB
testcase_14 AC 26 ms
11,924 KB
testcase_15 AC 39 ms
15,660 KB
testcase_16 AC 44 ms
16,344 KB
testcase_17 AC 37 ms
15,020 KB
testcase_18 AC 26 ms
11,676 KB
testcase_19 AC 41 ms
15,064 KB
testcase_20 AC 45 ms
16,316 KB
testcase_21 AC 37 ms
16,320 KB
testcase_22 AC 34 ms
13,840 KB
testcase_23 AC 32 ms
13,964 KB
testcase_24 AC 22 ms
10,028 KB
testcase_25 AC 31 ms
13,304 KB
testcase_26 AC 40 ms
14,964 KB
testcase_27 AC 42 ms
16,368 KB
testcase_28 AC 28 ms
12,836 KB
testcase_29 AC 65 ms
21,400 KB
testcase_30 AC 50 ms
17,528 KB
testcase_31 AC 27 ms
12,828 KB
testcase_32 AC 24 ms
10,760 KB
testcase_33 AC 33 ms
14,108 KB
testcase_34 AC 55 ms
17,280 KB
testcase_35 AC 38 ms
14,052 KB
testcase_36 AC 53 ms
17,484 KB
testcase_37 AC 63 ms
20,780 KB
testcase_38 AC 22 ms
10,020 KB
testcase_39 AC 39 ms
14,900 KB
testcase_40 AC 49 ms
16,280 KB
testcase_41 AC 16 ms
8,436 KB
testcase_42 AC 21 ms
9,784 KB
testcase_43 AC 16 ms
7,864 KB
testcase_44 AC 15 ms
7,760 KB
testcase_45 AC 16 ms
7,804 KB
testcase_46 AC 15 ms
7,860 KB
testcase_47 AC 15 ms
7,812 KB
testcase_48 AC 15 ms
7,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
# 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 = 10**16
# md = 998244353
md = 10**9+7

def ok():
    s=0
    cs=set()
    cs.add(0)
    for a in aa:
        s^=a
        if s^k in cs:return True
        cs.add(s)
    return False

n,k=LI()
aa=LI()

print("Yes" if ok() else "No")
0