Submission #446777

# Submission time Handle Problem Language Result Execution time Memory
446777 2021-07-23T09:01:03 Z osmanallazov XORanges (eJOI19_xoranges) C++14
55 / 100
1000 ms 2324 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
    ll n,q,l,r,s;
    cin>>n>>q;
    ll a[n+1];
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    while(q--){
        cin>>s>>l>>r;
        if(s==1){
            a[l]=r;
        }
        else{
            if(l%2!=r%2){
                cout<<0<<endl;
            }
            else{
                ll ans=0;
                for(int i=l;i<=r;i+=2){
                    ans^=a[i];
                }
                cout<<ans<<endl;
            }
        }
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 204 KB Output is correct
2 Correct 2 ms 204 KB Output is correct
3 Correct 2 ms 204 KB Output is correct
4 Correct 2 ms 204 KB Output is correct
5 Correct 2 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 2 ms 204 KB Output is correct
7 Correct 2 ms 204 KB Output is correct
8 Correct 2 ms 204 KB Output is correct
9 Correct 2 ms 204 KB Output is correct
10 Correct 2 ms 204 KB Output is correct
11 Correct 12 ms 328 KB Output is correct
12 Correct 12 ms 340 KB Output is correct
13 Correct 18 ms 348 KB Output is correct
14 Correct 17 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1094 ms 2324 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 2 ms 204 KB Output is correct
7 Correct 2 ms 204 KB Output is correct
8 Correct 2 ms 204 KB Output is correct
9 Correct 2 ms 204 KB Output is correct
10 Correct 2 ms 204 KB Output is correct
11 Correct 12 ms 328 KB Output is correct
12 Correct 12 ms 340 KB Output is correct
13 Correct 18 ms 348 KB Output is correct
14 Correct 17 ms 332 KB Output is correct
15 Execution timed out 1094 ms 2324 KB Time limit exceeded
16 Halted 0 ms 0 KB -