#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#define ll long long
#define pb push_back
#define F first
#define S second
#define ull unsigned long long
#define pii pair < int, int >
#define ld long double
using namespace std;
using namespace __gnu_pbds;
mt19937 gen(time(0));
template <typename T>
using ordered_set=tree<T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
vector < int > X({-1, 1, -1, 1, 0, 0, -1, 1});
vector < int > Y({-1, 1, 0, 0, -1, 1, 1, -1});
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifdef LOCAL
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#else
#endif
int n;
cin >> n;
int q;
cin >> q;
vector < int > a(n);
for (int i = 0; i < n; i++) cin >> a[i];
while (q--)
{
int z;
cin >> z;
if (z == 1)
{
int in, val;
cin >> in >> val;
a[in - 1] = val;
}
else
{
int l, r;
cin >> l>> r;
l--;
r--;
int ans = 0;
for (int i = 0; i <= r - l + 1; i++)
for (int j = l; j + i <= r; j++)
for (int u = j; u <= j + i; u++)
ans ^= a[u];
cout << ans << "\n";
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
2 ms |
384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
123 ms |
504 KB |
Output is correct |
2 |
Correct |
129 ms |
400 KB |
Output is correct |
3 |
Correct |
135 ms |
504 KB |
Output is correct |
4 |
Correct |
751 ms |
640 KB |
Output is correct |
5 |
Correct |
730 ms |
532 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
2 ms |
384 KB |
Output is correct |
6 |
Correct |
123 ms |
504 KB |
Output is correct |
7 |
Correct |
129 ms |
400 KB |
Output is correct |
8 |
Correct |
135 ms |
504 KB |
Output is correct |
9 |
Correct |
751 ms |
640 KB |
Output is correct |
10 |
Correct |
730 ms |
532 KB |
Output is correct |
11 |
Execution timed out |
1085 ms |
512 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1063 ms |
1152 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
2 ms |
384 KB |
Output is correct |
6 |
Correct |
123 ms |
504 KB |
Output is correct |
7 |
Correct |
129 ms |
400 KB |
Output is correct |
8 |
Correct |
135 ms |
504 KB |
Output is correct |
9 |
Correct |
751 ms |
640 KB |
Output is correct |
10 |
Correct |
730 ms |
532 KB |
Output is correct |
11 |
Execution timed out |
1085 ms |
512 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |