Submission #466145

# Submission time Handle Problem Language Result Execution time Memory
466145 2021-08-18T06:31:07 Z Stickfish XORanges (eJOI19_xoranges) C++17
55 / 100
1000 ms 1812 KB
#include <iostream>
using namespace std;

const int MAXN = 2e5 + 123;
int a[MAXN];

signed main(){
	int n, q;
	cin >> n >> q;
	for(int i = 0; i < n; ++i){
		cin >> a[i];
	}
	while(q--){
		int t;
		cin >> t;
		if(t == 1){
			int i, x;
			cin >> i >> x;
			--i;
			a[i] = x;
		} else {
			int l, r;
			cin >> l >> r;
			--l;
			if((r - l) % 2 == 0){
				cout << 0 << '\n';
				continue;
			}
			int ans = 0;
			for(int i = l; i < r; i += 2){
				ans ^= a[i];
			}
			cout << ans << '\n';
		}
	}
}
# 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 456 KB Output is correct
12 Correct 12 ms 452 KB Output is correct
13 Correct 20 ms 436 KB Output is correct
14 Correct 18 ms 452 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1087 ms 1812 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 456 KB Output is correct
12 Correct 12 ms 452 KB Output is correct
13 Correct 20 ms 436 KB Output is correct
14 Correct 18 ms 452 KB Output is correct
15 Execution timed out 1087 ms 1812 KB Time limit exceeded
16 Halted 0 ms 0 KB -