Task: | Xor sum |
Sender: | htoik |
Submission time: | 2024-09-23 16:37:57 +0300 |
Language: | C++ (C++20) |
Status: | READY |
Result: | TIME LIMIT EXCEEDED |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | TIME LIMIT EXCEEDED | -- | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:10:19: warning: comparison of integer expressions of different signedness: 'int' and 'ull' {aka 'long long unsigned int'} [-Wsign-compare] 10 | for(int i=0; i<n; i++){ | ~^~
Code
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; int main(){ ull n, q; std::cin >> n >> q; vector<ull> xs; for(int i=0; i<n; i++){ ull x; cin >> x; xs.push_back(x); } for(ull i=0; i<q; i++){ ull a, b; cin >> a >> b; ull sum = 0; for(ull j=a-1; j<=b-1; j++){ sum ^= xs[j]; } cout << sum << endl; } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
8 36 7 6 4 6 2 9 4 8 1 1 1 2 1 3 ... |
correct output |
---|
7 1 5 3 1 ... |
user output |
---|
7 1 5 3 1 ... |
Test 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000 200000 921726510 307633388 992247073 ... |
correct output |
---|
834756431 130379787 403037296 308618218 784778243 ... |
user output |
---|
(empty) |