結果

問題 No.1091 Range Xor Query
ユーザー Naru820
提出日時 2025-06-05 23:12:03
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 463 ms / 2,000 ms
コード長 949 bytes
コンパイル時間 8,944 ms
コンパイル使用メモリ 376,764 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-05 23:12:27
合計ジャッジ時間 21,428 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

//# pragma GCC target("avx")
# pragma GCC optimize("O3")
# pragma GCC optimize("unroll-loops")
#ifdef LOCAL
#define debug(x) cerr << #x << " = " << (x) << endl;
#else
#define debug(x) 
#endif
#include <bits/stdc++.h>
#include <optional> 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fast ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using namespace __gnu_pbds;
#include <atcoder/all>
using namespace atcoder;
constexpr ll inf = 2e18;
constexpr int mod = 998244353;

static void judge(bool c){
    cout << (c ? "Yes" : "No") << '\n';
}

int n,q,a[200000],l,r,x[200001];
int main() {
    cin >> n >> q;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        x[i + 1] = x[i] ^ a[i];
    }
    while(q--){
        cin >> l >> r;
        cout << (x[r] ^ x[l - 1]) << '\n';
    }
}
0