結果

問題 No.1091 Range Xor Query
ユーザー KKT89KKT89
提出日時 2020-06-26 06:33:47
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 304 ms / 2,000 ms
コード長 474 bytes
コンパイル時間 1,186 ms
コンパイル使用メモリ 84,324 KB
実行使用メモリ 4,868 KB
最終ジャッジ日時 2023-09-16 23:27:03
合計ジャッジ時間 8,327 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 30 ms
4,380 KB
testcase_04 AC 181 ms
4,384 KB
testcase_05 AC 178 ms
4,564 KB
testcase_06 AC 5 ms
4,380 KB
testcase_07 AC 197 ms
4,376 KB
testcase_08 AC 275 ms
4,376 KB
testcase_09 AC 140 ms
4,384 KB
testcase_10 AC 182 ms
4,376 KB
testcase_11 AC 240 ms
4,388 KB
testcase_12 AC 131 ms
4,856 KB
testcase_13 AC 292 ms
4,380 KB
testcase_14 AC 201 ms
4,380 KB
testcase_15 AC 210 ms
4,376 KB
testcase_16 AC 221 ms
4,380 KB
testcase_17 AC 286 ms
4,420 KB
testcase_18 AC 47 ms
4,376 KB
testcase_19 AC 45 ms
4,376 KB
testcase_20 AC 284 ms
4,380 KB
testcase_21 AC 143 ms
4,376 KB
testcase_22 AC 253 ms
4,416 KB
testcase_23 AC 303 ms
4,560 KB
testcase_24 AC 301 ms
4,868 KB
testcase_25 AC 303 ms
4,868 KB
testcase_26 AC 298 ms
4,688 KB
testcase_27 AC 304 ms
4,680 KB
権限があれば一括ダウンロードができます

ソースコード

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