結果

問題 No.1456 Range Xor
ユーザー nasubi24nasubi24
提出日時 2021-03-31 21:10:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 82,916 KB
実行使用メモリ 95,764 KB
最終ジャッジ日時 2024-12-15 12:53:03
合計ジャッジ時間 5,430 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
n,k=map(int,input().split())
a=list(map(int,input().split()))
d=defaultdict(int)
cnt=0
d[str(0)]=1
for i in range(n):
    cnt^=a[i]
    if d.get(str(cnt^k))==1:
        print("Yes")
        break
    d[str(cnt)]=1
else:
    print("No")
0