Submission #596770

#TimeUsernameProblemLanguageResultExecution timeMemory
596770CookieXORanges (eJOI19_xoranges)C++14
55 / 100
23 ms724 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define vt vector #define pb push_back ll a[5001]; int n, q; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> q; for(int i = 0; i < n; i++)cin >> a[i]; for(int i = 0; i < q; i++){ int qq; cin >> qq; if(qq == 2){ int l, r; cin >> l >> r; ll ans = 0; l--; r--; for(int j = l; j <= r; j++){ int val = (j - l + 1) * (r - j + 1); if(val & 1)ans ^= a[j]; } cout << ans << "\n"; }else{ int id, x; cin >> id >> x; a[--id] = x; } } }
#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...