結果

問題 No.1091 Range Xor Query
ユーザー 👑 deuteridayodeuteridayo
提出日時 2020-12-03 20:40:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 414 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 1,566 ms
コンパイル使用メモリ 165,444 KB
実行使用メモリ 6,604 KB
最終ジャッジ日時 2023-10-12 06:46:24
合計ジャッジ時間 14,318 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 57 ms
5,272 KB
testcase_04 AC 239 ms
4,352 KB
testcase_05 AC 267 ms
6,400 KB
testcase_06 AC 11 ms
4,352 KB
testcase_07 AC 267 ms
4,852 KB
testcase_08 AC 383 ms
5,440 KB
testcase_09 AC 183 ms
4,348 KB
testcase_10 AC 260 ms
5,592 KB
testcase_11 AC 342 ms
6,004 KB
testcase_12 AC 200 ms
6,368 KB
testcase_13 AC 395 ms
5,148 KB
testcase_14 AC 285 ms
5,776 KB
testcase_15 AC 305 ms
6,108 KB
testcase_16 AC 297 ms
4,352 KB
testcase_17 AC 404 ms
5,940 KB
testcase_18 AC 62 ms
4,352 KB
testcase_19 AC 76 ms
5,104 KB
testcase_20 AC 389 ms
5,028 KB
testcase_21 AC 184 ms
4,356 KB
testcase_22 AC 361 ms
5,668 KB
testcase_23 AC 404 ms
6,476 KB
testcase_24 AC 407 ms
6,472 KB
testcase_25 AC 410 ms
6,420 KB
testcase_26 AC 406 ms
6,460 KB
testcase_27 AC 414 ms
6,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using lint = long long;
long const mod = 1e9+7;
int main(){
    lint n,q;
    cin >> n >> q;
    lint a[n+1];
    for(int i=1;i<=n;i++)cin >> a[i];
    lint xorr[n+1];
    xorr[0] = 0;
    for(int i=1;i<=n;i++){
        xorr[i] = xorr[i-1] ^ a[i];
    }
    for(int i=0;i<q;i++){
        lint l,r;
        cin >> l >> r;
        cout << (xorr[l-1] ^ xorr[r] )<< endl;
    }
}
0