Submission #761157

# Submission time Handle Problem Language Result Execution time Memory
761157 2023-06-19T09:43:28 Z LucaLucaM XORanges (eJOI19_xoranges) C++17
55 / 100
1000 ms 3756 KB
#include <bits/stdc++.h>

using namespace std;

const int NMAX = 2e5;

int a[NMAX + 5];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, q;
    cin >> n >> q;
    for (int i=1; i<=n; i++)
        cin >> a[i];
    while (q--)
    {
        int op, x, y;
        cin >> op >> x >> y;
        if (op == 1)
            a[x] = y;
        else
        {
            int ans = 0;
            for (int i=x; i<=y; i++)
            {
                if ((i - x + 1) % 2 == 1 && (y - i + 1) % 2 == 1)
                    ans ^= a[i];
            }
            cout << ans << '\n';
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 5 ms 476 KB Output is correct
12 Correct 5 ms 468 KB Output is correct
13 Correct 22 ms 468 KB Output is correct
14 Correct 18 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1073 ms 3756 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 5 ms 476 KB Output is correct
12 Correct 5 ms 468 KB Output is correct
13 Correct 22 ms 468 KB Output is correct
14 Correct 18 ms 468 KB Output is correct
15 Execution timed out 1073 ms 3756 KB Time limit exceeded
16 Halted 0 ms 0 KB -