結果

問題 No.1091 Range Xor Query
ユーザー hiro1729hiro1729
提出日時 2023-09-02 08:44:30
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 450 ms / 2,000 ms
コード長 372 bytes
コンパイル時間 5,970 ms
コンパイル使用メモリ 307,132 KB
実行使用メモリ 6,080 KB
最終ジャッジ日時 2023-09-02 08:44:50
合計ジャッジ時間 18,997 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,356 KB
testcase_01 AC 1 ms
4,356 KB
testcase_02 AC 1 ms
4,356 KB
testcase_03 AC 61 ms
4,660 KB
testcase_04 AC 245 ms
4,356 KB
testcase_05 AC 273 ms
5,696 KB
testcase_06 AC 12 ms
4,352 KB
testcase_07 AC 291 ms
4,436 KB
testcase_08 AC 380 ms
4,712 KB
testcase_09 AC 192 ms
4,356 KB
testcase_10 AC 289 ms
5,852 KB
testcase_11 AC 352 ms
5,820 KB
testcase_12 AC 199 ms
5,656 KB
testcase_13 AC 408 ms
4,916 KB
testcase_14 AC 317 ms
5,712 KB
testcase_15 AC 344 ms
5,812 KB
testcase_16 AC 357 ms
4,356 KB
testcase_17 AC 445 ms
5,820 KB
testcase_18 AC 68 ms
4,352 KB
testcase_19 AC 83 ms
4,708 KB
testcase_20 AC 450 ms
4,448 KB
testcase_21 AC 204 ms
4,356 KB
testcase_22 AC 400 ms
5,764 KB
testcase_23 AC 444 ms
5,920 KB
testcase_24 AC 400 ms
6,024 KB
testcase_25 AC 413 ms
5,992 KB
testcase_26 AC 435 ms
5,944 KB
testcase_27 AC 410 ms
6,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;

int op(int a, int b) {
	return a ^ b;
}

int e() {
	return 0;
}

int main() {
	int n, q;
	cin >> n >> q;
	segtree<int, op, e> seg(n);
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		seg.set(i, a);
	}
	int l, r;
	while (cin >> l >> r) cout << seg.prod(l - 1, r) << '\n';
}
0