제출 #437437

#제출 시각아이디문제언어결과실행 시간메모리
437437MinhQNgoXORanges (eJOI19_xoranges)C++17
55 / 100
9 ms460 KiB
#include <bits/stdc++.h> using namespace std; const int N = 5005; int a[N]; long long p[N]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, q; cin >> n >> q; for (int i = 1; i <= n; i++) { cin >> a[i]; p[i] = p[i - 1] ^ a[i]; } for (int _ = 0; _ < q; _++) { int t, x, y; cin >> t >> x >> y; if (t == 1) a[x] = y; else { if (x % 2 != y % 2) { cout << 0 << '\n'; } else { long long ans = 0; for (int i = x; i <= y; i += 2) ans ^= a[i]; cout << ans << '\n'; } } } }
#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...