結果

問題 No.1091 Range Xor Query
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2020-06-26 00:04:43
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 398 ms / 2,000 ms
コード長 451 bytes
コンパイル時間 1,012 ms
コンパイル使用メモリ 144,972 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-16 23:19:38
合計ジャッジ時間 9,834 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 51 ms
4,376 KB
testcase_04 AC 221 ms
4,376 KB
testcase_05 AC 247 ms
4,380 KB
testcase_06 AC 10 ms
4,380 KB
testcase_07 AC 253 ms
4,376 KB
testcase_08 AC 353 ms
4,376 KB
testcase_09 AC 171 ms
4,380 KB
testcase_10 AC 234 ms
4,380 KB
testcase_11 AC 308 ms
4,376 KB
testcase_12 AC 181 ms
4,376 KB
testcase_13 AC 368 ms
4,380 KB
testcase_14 AC 267 ms
4,380 KB
testcase_15 AC 288 ms
4,376 KB
testcase_16 AC 277 ms
4,380 KB
testcase_17 AC 381 ms
4,380 KB
testcase_18 AC 58 ms
4,376 KB
testcase_19 AC 71 ms
4,380 KB
testcase_20 AC 356 ms
4,376 KB
testcase_21 AC 175 ms
4,376 KB
testcase_22 AC 335 ms
4,380 KB
testcase_23 AC 382 ms
4,376 KB
testcase_24 AC 379 ms
4,380 KB
testcase_25 AC 382 ms
4,380 KB
testcase_26 AC 378 ms
4,380 KB
testcase_27 AC 398 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *   @FileName	a.cpp
 *   @Author	kanpurin
 *   @Created	2020.06.26 00:04:39
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

int main() {
    int n,q;cin >> n >> q;
    vector<int> sum(n+1);
    for (int i = 0; i < n; i++) {
        int a;cin >> a;
        sum[i + 1] = a ^ sum[i];
    }
    for (int i = 0; i < q; i++) {
        int l,r;cin >> l >> r;
        cout << (sum[l-1] ^ sum[r]) << endl;
    }
    return 0;
}
0