結果
問題 | No.1091 Range Xor Query |
ユーザー |
|
提出日時 | 2020-06-26 23:46:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 63 ms / 2,000 ms |
コード長 | 470 bytes |
コンパイル時間 | 1,473 ms |
コンパイル使用メモリ | 167,256 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 00:40:24 |
合計ジャッジ時間 | 5,139 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 27 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;constexpr char newl = '\n';int main() {cin.tie(nullptr);ios::sync_with_stdio(false);int n, q;cin >> n >> q;vector<int> a(n + 1, 0);for (int i = 1; i <= n; i++) {cin >> a[i];a[i] ^= a[i - 1];}for (int i = 0; i < q; i++) {int l, r;cin >> l >> r;--l;cout << (a[l] ^ a[r]) << newl;}return 0;}