結果

問題 No.1456 Range Xor
コンテスト
ユーザー t98slider
提出日時 2026-11-23 03:23:58
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 47 ms / 2,000 ms
+ 746µs
コード長 402 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,374 ms
コンパイル使用メモリ 343,084 KB
実行使用メモリ 9,904 KB
最終ジャッジ日時 2026-11-23 03:24:05
合計ジャッジ時間 6,205 ms
ジャッジサーバーID
(参考情報)
judge6_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 47
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k, v, tot = 0;
    cin >> n >> k;
    set<int> S = {0};
    for(int i = 0; i < n; i++){
        cin >> v;
        tot ^= v;
        if(S.count(tot ^ k)){
            cout << "Yes\n";
            return 0;
        }
		S.insert(tot);
    }
    cout << "No\n";
}
0