結果

問題 No.1091 Range Xor Query
ユーザー kokatsukokatsu
提出日時 2021-11-19 00:17:21
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 185 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 2,389 ms
コンパイル使用メモリ 205,628 KB
実行使用メモリ 11,760 KB
最終ジャッジ日時 2023-09-04 15:00:14
合計ジャッジ時間 11,047 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 30 ms
8,440 KB
testcase_04 AC 107 ms
4,628 KB
testcase_05 AC 124 ms
11,376 KB
testcase_06 AC 7 ms
4,592 KB
testcase_07 AC 119 ms
8,784 KB
testcase_08 AC 173 ms
8,452 KB
testcase_09 AC 84 ms
5,012 KB
testcase_10 AC 119 ms
10,136 KB
testcase_11 AC 156 ms
10,432 KB
testcase_12 AC 94 ms
11,104 KB
testcase_13 AC 182 ms
8,112 KB
testcase_14 AC 131 ms
10,064 KB
testcase_15 AC 141 ms
9,720 KB
testcase_16 AC 132 ms
4,992 KB
testcase_17 AC 185 ms
10,456 KB
testcase_18 AC 29 ms
4,380 KB
testcase_19 AC 39 ms
8,164 KB
testcase_20 AC 174 ms
8,068 KB
testcase_21 AC 81 ms
4,428 KB
testcase_22 AC 166 ms
9,556 KB
testcase_23 AC 179 ms
11,724 KB
testcase_24 AC 180 ms
11,760 KB
testcase_25 AC 180 ms
11,656 KB
testcase_26 AC 180 ms
11,616 KB
testcase_27 AC 180 ms
11,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int N, Q;
    readf("%d %d\n", N, Q);

    auto a = [0] ~ readln.chomp.split.to!(int[]);

    auto b = a.cumulativeFold!"a ^ b".array;

    foreach (i; 0 .. Q) {
        int l, r;
        readf("%d %d\n", l, r);

        --l;

        int res = b[r] ^ b[l];
        res.writeln;
    }
}
0