結果

問題 No.1091 Range Xor Query
ユーザー KKT89
提出日時 2020-06-26 06:33:47
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 316 ms / 2,000 ms
コード長 474 bytes
コンパイル時間 723 ms
コンパイル使用メモリ 81,052 KB
最終ジャッジ日時 2025-01-11 10:32:44
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
using namespace std;
typedef long long int ll;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,q; cin >> n >> q;
    vector<int> a(n),v(n+1,0);
    for(int i=0;i<n;i++){
        cin >> a[i];
        v[i+1]=a[i];
        v[i+1]^=v[i];
    }
    while(q--){
        int l,r; cin >> l >> r;
        cout << (v[r]^v[l-1]) << endl;
    }
}
0