Submission #446682

#TimeUsernameProblemLanguageResultExecution timeMemory
446682fuad27XORanges (eJOI19_xoranges)C++14
55 / 100
1084 ms3524 KiB
#include<bits/stdc++.h> using namespace std; int main () { int n, q; cin >> n >> q; vector<int> v(n, 0); for(int i = 0;i<n;i++) { int p; cin >> p; v[i] = p; } while(q--) { int k; cin >> k; if(k == 2) { int s = 0; int l, u; cin >> l >> u; l--; u = min(u, n); for(int i = l;i<u;i++) { if(((i - l + 1)*(u - i))%2)s^=v[i]; } cout<<s<<endl; } else { int i, j; cin >> i >> j; v[i-1] = j; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...