結果

問題 No.1456 Range Xor
ユーザー lam6er
提出日時 2025-03-26 15:55:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 588 ms
コンパイル使用メモリ 82,596 KB
実行使用メモリ 96,472 KB
最終ジャッジ日時 2025-03-26 15:56:01
合計ジャッジ時間 5,506 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
a = list(map(int, input().split()))
prefix_set = {0}
current_xor = 0
found = False

for num in a:
    current_xor ^= num
    target = current_xor ^ k
    if target in prefix_set:
        found = True
        break
    prefix_set.add(current_xor)

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