답안 #761159

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
761159 2023-06-19T09:44:48 Z LucaLucaM XORanges (eJOI19_xoranges) C++17
55 / 100
1000 ms 1672 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;
            if (x % 2 != y % 2)
            {
                cout << "0\n";
                continue;
            }
            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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 3 ms 340 KB Output is correct
12 Correct 4 ms 340 KB Output is correct
13 Correct 10 ms 376 KB Output is correct
14 Correct 15 ms 360 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1082 ms 1672 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 3 ms 340 KB Output is correct
12 Correct 4 ms 340 KB Output is correct
13 Correct 10 ms 376 KB Output is correct
14 Correct 15 ms 360 KB Output is correct
15 Execution timed out 1082 ms 1672 KB Time limit exceeded
16 Halted 0 ms 0 KB -