Submission #968832

# Submission time Handle Problem Language Result Execution time Memory
968832 2024-04-24T07:07:15 Z vjudge1 XORanges (eJOI19_xoranges) C++17
0 / 100
1000 ms 2004 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 {
            sum = o[y];
            for (int i=y+1;i<k;i++) {
                sum^=o[i];
            }
            for (int i=y;i<k-1;i++) {
                sum^=(o[i]^o[i+1]);
            }
            for (int i=y;i<k-2;i++) {
                sum^=(o[i]^o[i+1]^o[i+2]);
            }
            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 344 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 Execution timed out 1071 ms 2004 KB Time limit exceeded
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 -