Submission #596770

# Submission time Handle Problem Language Result Execution time Memory
596770 2022-07-15T03:49:11 Z Cookie XORanges (eJOI19_xoranges) C++14
55 / 100
23 ms 724 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vt vector
#define pb push_back
ll a[5001];
int n, q;
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> q;
	for(int i = 0; i < n; i++)cin >> a[i];
	for(int i = 0; i < q; i++){
	    int qq; cin >> qq;
	    if(qq == 2){
	    int l, r; cin >> l >> r;
	    ll ans = 0;
	    l--; r--;
	    for(int j = l; j <= r; j++){
	        int val = (j - l + 1) * (r - j + 1);
	        if(val & 1)ans ^= a[j];
	    }
	    cout << ans << "\n";
	    }else{
	        int id, x; cin >> id >> x; a[--id] = x;
	    }
	}
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 320 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 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 320 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 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 2 ms 340 KB Output is correct
11 Correct 9 ms 472 KB Output is correct
12 Correct 7 ms 468 KB Output is correct
13 Correct 23 ms 480 KB Output is correct
14 Correct 23 ms 472 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 724 KB Execution killed with signal 11
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 320 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 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 2 ms 340 KB Output is correct
11 Correct 9 ms 472 KB Output is correct
12 Correct 7 ms 468 KB Output is correct
13 Correct 23 ms 480 KB Output is correct
14 Correct 23 ms 472 KB Output is correct
15 Runtime error 2 ms 724 KB Execution killed with signal 11
16 Halted 0 ms 0 KB -