結果

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

ソースコード

diff #

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

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

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