Submission #838156

#TimeUsernameProblemLanguageResultExecution timeMemory
838156BlockOGXORanges (eJOI19_xoranges)C++14
55 / 100
1075 ms2156 KiB
#include <iostream> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, q; cin >> n >> q; unsigned int o[n]; for (int i = 0; i < n; i++) cin >> o[i]; int code; for (int it = 0; it < q; it++) { cin >> code; if (code == 1) { int i; cin >> i >> o[--i]; } else { int l, u; cin >> l >> u; if (!((u - l + 1) & 1)) { cout << 0 << endl; continue; } unsigned int res = 0; for (int i = l - 1; i < u; i += 2) res ^= o[i]; cout << res << endl; } } }
#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...