#include <iostream>
#include <vector>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits.h>
#include <set>
#define ll long long
#include <queue>
#include <functional>
#include <string>
#include <string.h>
#define ull unsigned long long
using namespace std;
ll llmax(ll a, ll b) {
if (a > b) {
return a;
}
return b;
}
ll llmin(ll a, ll b) {
if (a < b) {
return a;
}
return b;
}
using namespace std;
bool is_Prime(int n) {
if (n == 2) {
return true;
}
int d = 3;
while (d * d <= n and n % d != 0) {
d += 2;
}
return d * d > n;
}
ll gcd(ll a, ll b) {
while (b) {
a %= b;
std::swap(a, b);
}
return a;
}
bool isPowerOfTwo(int n) {
while (n % 2 == 0) {
n /= 2;
}
return n == 1;
}
ll factorial(ll n) {
ll p = 1;
for (ll i = 2; i <= n; i++) {
p *= i;
}
return p;
}
long long lcm(int a, int b)
{
return (a / gcd(a, b)) * b;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int t = 1;
//cin >> t;
while (t--) {
int n, q;
cin >> n>>q;
vector<int> v(n + 1);
for (int i = 1; i <= n; i++) {
cin >> v[i];
}
while (q--) {
int tp;
cin >> tp;
if (tp == 1) {
int x, y;
cin >> x >> y;
v[x] = y;
}
else {
int l, r;
cin >> l >> r;
int ans = 0;
for (int i = 0; i < r - l + 1; i++) {
if ((i + 1) * (r - l - i + 1) % 2) {
ans ^= v[i + l];
}
}
cout << ans << "\n";
}
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |