Submission #288537

# Submission time Handle Problem Language Result Execution time Memory
288537 2020-09-01T15:34:39 Z FulopMate XORanges (eJOI19_xoranges) C++14
0 / 100
24 ms 1660 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    int n, q; cin>>n>>q;
    vector<int> v = {-1};
    for (int i = 0; i < n; i++)
    {
        int a; cin>>a;
        v.push_back(a);
    }
    for (int asd = 0; asd < q && asd < 50; asd++)
    {
        int type; cin>>type;
        int l, r; cin>>l>>r;
        if(type==1) v[l] = r;
        else
        {
            int rr = 0;
            int len = r-l+1;
            if(len%2==0) cout<<0<<endl;
            else if (len==1)cout<<v[l]<<endl;
            else{
                for(int i = l; i <= l+len/2-1; i+=2){
                    rr ^= v[i];
                }
                for(int i = r; i >= l+len/2; i-=2){
                    rr ^= v[i];
                }
                // if(len > 3)rr ^= v[l+len/2];
                cout<<rr<<endl;
            }
            
        }
    }
    
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 1660 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -