Submission #792223

# Submission time Handle Problem Language Result Execution time Memory
792223 2023-07-24T18:33:54 Z Godgift42 XORanges (eJOI19_xoranges) C++14
55 / 100
1000 ms 5392 KB
#include <bits/stdc++.h>
using namespace std;


int main(){
    int n,q;
    cin >> n >> q;
    vector<int> a(n);
    for(int i=0;i<n;i++) cin >> a[i];
        while(q--){
        int action;
        cin >> action;
        if(action==1){
            int pos,ch;
            cin >> pos >> ch;
            a[pos-1]=ch;
        }
        else{
            int l,u;
            cin >> l >> u;
            if((u-l)%2==1) cout << 0<<"\n";
            else{
                int xum=0;
                for(int i=l-1;i<u;i+=2){
                    xum=xum^a[i];
                }
                cout << xum<<"\n";
            }
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 308 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 308 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 8 ms 340 KB Output is correct
12 Correct 8 ms 340 KB Output is correct
13 Correct 12 ms 340 KB Output is correct
14 Correct 12 ms 440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1081 ms 5392 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 308 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 8 ms 340 KB Output is correct
12 Correct 8 ms 340 KB Output is correct
13 Correct 12 ms 340 KB Output is correct
14 Correct 12 ms 440 KB Output is correct
15 Execution timed out 1081 ms 5392 KB Time limit exceeded
16 Halted 0 ms 0 KB -