Submission #260066

# Submission time Handle Problem Language Result Execution time Memory
260066 2020-08-09T08:16:52 Z mosiashvililuka XORanges (eJOI19_xoranges) C++14
100 / 100
585 ms 7964 KB
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,fen[100009][2],tes,t,tp,f[200009];
void upd(int q, int w, int rr){
    while(q<=100000){
        fen[q][w]^=rr;
        q=q+(q&(-q));
    }
}
int read(int q, int w){
    int jm=0;
    while(q>=1){
        jm^=fen[q][w];
        q=q-(q&(-q));
    }
    return jm;
}
int main(){
    ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    cin>>a>>tes;
    for(i=1; i<=a; i++){
        cin>>f[i];
        upd(i/2+i%2,i%2,f[i]);
    }
    for(t=1; t<=tes; t++){
        cin>>tp>>c>>d;
        if(tp==1){
            upd(c/2+c%2,c%2,(f[c]^d));
            f[c]=d;
        }else{
            if((d-c+1)%2==0){
                cout<<0<<endl;
                continue;
            }
            e=c%2;
            c-=2;
            cout<<(read(d/2+d%2,e)^read(c/2+c%2,e))<<endl;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 2 ms 384 KB Output is correct
10 Correct 2 ms 384 KB Output is correct
11 Correct 11 ms 512 KB Output is correct
12 Correct 9 ms 512 KB Output is correct
13 Correct 14 ms 512 KB Output is correct
14 Correct 14 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 583 ms 7940 KB Output is correct
2 Correct 565 ms 7964 KB Output is correct
3 Correct 570 ms 7928 KB Output is correct
4 Correct 585 ms 7772 KB Output is correct
5 Correct 563 ms 7544 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 2 ms 384 KB Output is correct
10 Correct 2 ms 384 KB Output is correct
11 Correct 11 ms 512 KB Output is correct
12 Correct 9 ms 512 KB Output is correct
13 Correct 14 ms 512 KB Output is correct
14 Correct 14 ms 512 KB Output is correct
15 Correct 583 ms 7940 KB Output is correct
16 Correct 565 ms 7964 KB Output is correct
17 Correct 570 ms 7928 KB Output is correct
18 Correct 585 ms 7772 KB Output is correct
19 Correct 563 ms 7544 KB Output is correct
20 Correct 368 ms 7688 KB Output is correct
21 Correct 357 ms 7720 KB Output is correct
22 Correct 363 ms 7800 KB Output is correct
23 Correct 546 ms 7548 KB Output is correct
24 Correct 544 ms 7544 KB Output is correct