Submission #464083

#TimeUsernameProblemLanguageResultExecution timeMemory
464083gagik_2007XORanges (eJOI19_xoranges)C++17
55 / 100
1098 ms2004 KiB
#include <iostream> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <set> #include <map> #include <queue> #include <deque> #include <stack> #include <iomanip> #include <unordered_set> using namespace std; #define ll long long #define ff first #define ss second ll n, k, sum, m, s, f; ll MOD = 1e9 + 7; ll ttt; ll a[200007]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> k; for (int i = 1; i <= n; i++) { cin >> a[i]; } for (int j = 0; j < k; j++) { ll id, c, d; cin >> id >> c >> d; if (id == 1) { a[c] = d; } else { ll ans = 0; ll m = 2 * n - c - d - 1; for (int i = c; i <= d; i++) { ll f = i - c + 1; ll x = min(f, m - f + 1); if (m * x % 2 != 0) { ans = ans ^ a[i]; } //cout << a[i] << " " << cur[a[i]] << endl; } cout << ans << endl; } } return 0; }
#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...