#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++) {
int id, c, d;
cin >> id >> c >> d;
if (id == 1) {
a[c] = d;
}
else {
map<ll, ll>cur;
unordered_set<ll>nw;
ll ans = 0;
for (int i = c; i <= d; i++) {
int f = i - c + 1;
int m = 2 * n - c - d - 1;
int x = min(f, m - f + 1);
cur[a[i]] += (x - 1) * x + (m - 2 * (x - 1)) * x;
nw.insert(a[i]);
//cout << a[i] << " " << cur[a[i]] << endl;
}
for (auto i : nw) {
if (cur[i] % 2 != 0) {
ans = ans ^ i;
}
}
cout << ans << endl;
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
2 ms |
332 KB |
Output is correct |
5 |
Correct |
2 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
324 KB |
Output is correct |
2 |
Correct |
26 ms |
288 KB |
Output is correct |
3 |
Correct |
30 ms |
332 KB |
Output is correct |
4 |
Correct |
84 ms |
452 KB |
Output is correct |
5 |
Correct |
78 ms |
332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
2 ms |
332 KB |
Output is correct |
5 |
Correct |
2 ms |
204 KB |
Output is correct |
6 |
Correct |
28 ms |
324 KB |
Output is correct |
7 |
Correct |
26 ms |
288 KB |
Output is correct |
8 |
Correct |
30 ms |
332 KB |
Output is correct |
9 |
Correct |
84 ms |
452 KB |
Output is correct |
10 |
Correct |
78 ms |
332 KB |
Output is correct |
11 |
Execution timed out |
1089 ms |
1104 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1078 ms |
17748 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
2 ms |
332 KB |
Output is correct |
5 |
Correct |
2 ms |
204 KB |
Output is correct |
6 |
Correct |
28 ms |
324 KB |
Output is correct |
7 |
Correct |
26 ms |
288 KB |
Output is correct |
8 |
Correct |
30 ms |
332 KB |
Output is correct |
9 |
Correct |
84 ms |
452 KB |
Output is correct |
10 |
Correct |
78 ms |
332 KB |
Output is correct |
11 |
Execution timed out |
1089 ms |
1104 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |