Submission #968838

# Submission time Handle Problem Language Result Execution time Memory
968838 2024-04-24T07:17:34 Z vjudge1 XORanges (eJOI19_xoranges) C++17
0 / 100
68 ms 8488 KB
#include<bits/stdc++.h>
#define ll long

using namespace std;
ll o[200001];
int main(){
    cin.tie(nullptr)->sync_with_stdio(false);
    ll n,m;
    cin >> n >> m;

    for (int i=0;i<n;i++) {
        cin >> o[i];
    }
    int x,y,k;
    ll sum=0;
    for (int i=0;i<m;i++) {
        cin >> x >> y >> k;
        y--;
        if (x == 1) {
            o[y] = k;
        } else {
            if (k-y < 3 && k-y >= 2) {
                sum = o[y+1];
                for (int i=y+2;i<k-1;i++) {
                    sum^=o[i];
                }
            } else if (k-y < 2) {
                sum = o[y];
                for (int i=y+1;i<k;i++) {
                    sum^=o[i];
                }
            } else {
                sum = o[y]^o[y+1]^o[k-2]^o[k-1];
            }
            cout << sum <<'\n';
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 68 ms 8488 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -