結果

問題 No.1456 Range Xor
ユーザー titia
提出日時 2021-03-31 21:33:08
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 28,228 KB
最終ジャッジ日時 2024-12-15 15:43:51
合計ジャッジ時間 5,218 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43 WA * 3
権限があれば一括ダウンロードができます

ソースコード

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:])

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