結果
問題 |
No.1091 Range Xor Query
|
ユーザー |
![]() |
提出日時 | 2021-03-30 21:32:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 421 ms / 2,000 ms |
コード長 | 368 bytes |
コンパイル時間 | 635 ms |
コンパイル使用メモリ | 70,992 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 21:56:13 |
合計ジャッジ時間 | 11,544 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 27 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n, q; cin >> n >> q; vector<int> a(n+1, 0); for(int i=0; i<n; ++i) { cin >> a[i+1]; a[i+1] ^= a[i]; } for (int i = 0; i < q; ++i) { int l, r; cin >> l >> r; l--; cout << (a[r]^a[l]) << endl; } }