Submission #968869

# Submission time Handle Problem Language Result Execution time Memory
968869 2024-04-24T08:10:12 Z vjudge1 XORanges (eJOI19_xoranges) C++17
0 / 100
1000 ms 4448 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=0;
            for (int i=0;i<(k-y)/2;i++) {
                sum^=(((i*(i+1))/2+(k-y-i)*(i+1))%2)*o[y+i];
                sum^=(((i*(i+1))/2+(k-y-i)*(i+1))%2)*o[k-(y+i)-1];
            }
            if ((k-y)%2 == 1) {
                sum^=((((k-y)*(k-y+1))/2)%2)*o[(k-y)/2];
            }
            cout << sum <<'\n';
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 356 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 0 ms 356 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1050 ms 4448 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 356 KB Output isn't correct
2 Halted 0 ms 0 KB -