Submission #908534

# Submission time Handle Problem Language Result Execution time Memory
908534 2024-01-16T13:45:53 Z speedcode XORanges (eJOI19_xoranges) C++17
55 / 100
1000 ms 6748 KB
#include <bits/stdc++.h>
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,q;
    cin >> n >> q;
    long long values[n];
    for(int i = 0; i < n; i++) cin >> values[i];
    int index, l, k, typ;
    long long res;
    for(int _i = 0; _i < q; _i++){
        cin >> typ;
        if(typ==1){
            int index;
            cin >> index;
            cin >> values[index-1];
        } else {
            cin >> l >> k;
            res = 0;
            if((l-k)%2 == 0){
                for(int i = l-1; i < k; i+= 2){
                    res = res ^ values[i];
                }
            }

            cout << res << '\n';
        }   
    }
}

Compilation message

xoranges.cpp: In function 'int main()':
xoranges.cpp:11:9: warning: unused variable 'index' [-Wunused-variable]
   11 |     int index, l, k, typ;
      |         ^~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 2 ms 604 KB Output is correct
12 Correct 2 ms 468 KB Output is correct
13 Correct 5 ms 600 KB Output is correct
14 Correct 5 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1061 ms 6748 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 2 ms 604 KB Output is correct
12 Correct 2 ms 468 KB Output is correct
13 Correct 5 ms 600 KB Output is correct
14 Correct 5 ms 604 KB Output is correct
15 Execution timed out 1061 ms 6748 KB Time limit exceeded
16 Halted 0 ms 0 KB -