結果
| 問題 |
No.1091 Range Xor Query
|
| ユーザー |
|
| 提出日時 | 2022-02-03 00:00:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 434 ms / 2,000 ms |
| コード長 | 344 bytes |
| コンパイル時間 | 811 ms |
| コンパイル使用メモリ | 69,248 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-11 09:38:50 |
| 合計ジャッジ時間 | 11,298 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 27 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n,q;cin>>n>>q;
vector<int> A(n);
vector<int> B(n+1);
B[0] = 0;
for(int i = 0; n > i; i++){
cin>>A[i];
B[i+1] = B[i]^A[i];
}
for(int i = 0; q > i; i++){
int x,y;cin>>x>>y;
cout << (B[x-1]^B[y]) << endl;
}
}