Submission #1098077

#TimeUsernameProblemLanguageResultExecution timeMemory
1098077Alihan_8XORanges (eJOI19_xoranges)C++17
55 / 100
1083 ms1116 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--; int ans = 0; for ( int i = l; i <= u; i++ ){ int x = (i - l + 1), y = (u - i + 1); if ( (x * 1LL * y) & 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...