結果

問題 No.1456 Range Xor
コンテスト
ユーザー LyricalMaestro
提出日時 2026-02-01 02:54:12
言語 PyPy3
(7.3.17)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 383 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 235 ms
コンパイル使用メモリ 82,240 KB
実行使用メモリ 95,932 KB
最終ジャッジ日時 2026-02-01 02:54:21
合計ジャッジ時間 7,111 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 46
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

## https://yukicoder.me/problems/no/1456




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

    a_set = {0}
    cum_xor = 0
    for a in A:
        cum_xor ^= a

        if (K ^ cum_xor) in a_set:
            print("Yes")
            return 
        

        a_set.add(cum_xor)
    print("No")








if __name__ == "__main__":
    main()
0