#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n, q, i;
cin>>n>>q;
vector<ll> a(n+1);
for(i=1; i<=n; i++){
cin>>a[i];
}
while(q--){
int t;
cin>>t;
if(t==1){
ll j, asdf;
cin>>j>>asdf;
a[j]=asdf;
}
else{
ll l, r;
cin>>l>>r;
if((r-l)%2==1) cout<<0<<endl;
else{
ll c=0;
for(i=l; i<=r; i+=2){
c=(c^a[i]);
}
cout<<c<<endl;
}
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
300 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
296 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
212 KB |
Output is correct |
3 |
Correct |
3 ms |
212 KB |
Output is correct |
4 |
Correct |
2 ms |
312 KB |
Output is correct |
5 |
Correct |
2 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
300 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
296 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
3 ms |
212 KB |
Output is correct |
7 |
Correct |
2 ms |
212 KB |
Output is correct |
8 |
Correct |
3 ms |
212 KB |
Output is correct |
9 |
Correct |
2 ms |
312 KB |
Output is correct |
10 |
Correct |
2 ms |
212 KB |
Output is correct |
11 |
Correct |
12 ms |
472 KB |
Output is correct |
12 |
Correct |
15 ms |
468 KB |
Output is correct |
13 |
Correct |
18 ms |
448 KB |
Output is correct |
14 |
Correct |
19 ms |
440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1078 ms |
2500 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
300 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
296 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
3 ms |
212 KB |
Output is correct |
7 |
Correct |
2 ms |
212 KB |
Output is correct |
8 |
Correct |
3 ms |
212 KB |
Output is correct |
9 |
Correct |
2 ms |
312 KB |
Output is correct |
10 |
Correct |
2 ms |
212 KB |
Output is correct |
11 |
Correct |
12 ms |
472 KB |
Output is correct |
12 |
Correct |
15 ms |
468 KB |
Output is correct |
13 |
Correct |
18 ms |
448 KB |
Output is correct |
14 |
Correct |
19 ms |
440 KB |
Output is correct |
15 |
Execution timed out |
1078 ms |
2500 KB |
Time limit exceeded |
16 |
Halted |
0 ms |
0 KB |
- |