結果

問題 No.1456 Range Xor
ユーザー titiatitia
提出日時 2021-03-31 21:34:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 428 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 25,996 KB
最終ジャッジ日時 2023-08-21 23:48:36
合計ジャッジ時間 5,029 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,592 KB
testcase_01 AC 18 ms
8,464 KB
testcase_02 AC 18 ms
8,600 KB
testcase_03 AC 92 ms
25,796 KB
testcase_04 AC 83 ms
25,864 KB
testcase_05 AC 93 ms
25,996 KB
testcase_06 AC 85 ms
25,840 KB
testcase_07 AC 110 ms
25,740 KB
testcase_08 AC 92 ms
25,852 KB
testcase_09 AC 86 ms
25,872 KB
testcase_10 AC 82 ms
25,760 KB
testcase_11 AC 36 ms
11,528 KB
testcase_12 AC 26 ms
10,052 KB
testcase_13 AC 49 ms
14,136 KB
testcase_14 AC 42 ms
14,064 KB
testcase_15 AC 69 ms
20,784 KB
testcase_16 AC 64 ms
19,976 KB
testcase_17 AC 62 ms
15,680 KB
testcase_18 AC 38 ms
14,056 KB
testcase_19 AC 59 ms
17,680 KB
testcase_20 AC 68 ms
19,812 KB
testcase_21 AC 55 ms
18,060 KB
testcase_22 AC 57 ms
18,456 KB
testcase_23 AC 44 ms
14,940 KB
testcase_24 AC 33 ms
11,436 KB
testcase_25 AC 47 ms
13,704 KB
testcase_26 AC 68 ms
17,536 KB
testcase_27 AC 60 ms
19,664 KB
testcase_28 AC 43 ms
13,664 KB
testcase_29 AC 116 ms
24,928 KB
testcase_30 AC 81 ms
25,260 KB
testcase_31 AC 40 ms
12,640 KB
testcase_32 AC 36 ms
11,620 KB
testcase_33 AC 49 ms
15,516 KB
testcase_34 AC 83 ms
25,432 KB
testcase_35 AC 52 ms
17,060 KB
testcase_36 AC 88 ms
25,744 KB
testcase_37 AC 107 ms
21,132 KB
testcase_38 AC 34 ms
11,528 KB
testcase_39 AC 64 ms
20,560 KB
testcase_40 AC 86 ms
19,804 KB
testcase_41 AC 20 ms
8,936 KB
testcase_42 AC 29 ms
10,216 KB
testcase_43 AC 18 ms
8,584 KB
testcase_44 AC 19 ms
8,584 KB
testcase_45 AC 18 ms
8,464 KB
testcase_46 AC 18 ms
8,636 KB
testcase_47 AC 18 ms
8,520 KB
testcase_48 AC 18 ms
8,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import Counter

N,K=map(int,input().split())
A=list(map(int,input().split()))

X=[0]
for a in A:
    X.append(X[-1]^a)

Y=Counter(X[1:])

if Y[K]>=1:
    print("Yes")
    exit()

for y in Y:
    k=K^y
    if k==y:
        if Y[k]>=2:
            print("Yes")
            break
    else:
        if Y[k]>=1:
            print("Yes")
            break

else:
    print("No")
0