Submission #1098079

#TimeUsernameProblemLanguageResultExecution timeMemory
1098079Alihan_8XORanges (eJOI19_xoranges)C++17
55 / 100
1045 ms4016 KiB
#include <bits/stdc++.h> using namespace std; signed main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int n, q; cin >> n >> q; vector <int> a(n); for ( auto &u: a ) cin >> u; while ( q-- ){ int t, l, u; cin >> t >> l >> u; if ( t == 1 ){ a[l - 1] = u; } else{ l--, u--; if ( (u - l) & 1 ){ cout << "0\n"; continue; } int ans = 0; for ( int i = l; i <= u; i++ ){ if ( (i - l + 1) & 1 ) ans ^= a[i]; } cout << ans << '\n'; } } cout << '\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...