Submission #1098077

# Submission time Handle Problem Language Result Execution time Memory
1098077 2024-10-09T03:21:16 Z Alihan_8 XORanges (eJOI19_xoranges) C++17
55 / 100
1000 ms 1116 KB
#include <bits/stdc++.h>

using namespace std;

signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int n, q; cin >> n >> q;
	
	vector <int> a(n);
	
	for ( auto &u: a ) cin >> u;
	
	while ( q-- ){
		int t, l, u; cin >> t >> l >> u;
		
		if ( t == 1 ){
			a[l - 1] = u;
		} else{
			l--, u--;
			
			int ans = 0;
			
			for ( int i = l; i <= u; i++ ){
				int x = (i - l + 1), y = (u - i + 1);
				
				if ( (x * 1LL * y) & 1 ) ans ^= a[i];
			}
			
			cout << ans << '\n';
		}
	}
	
	cout << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 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 348 KB Output is correct
2 Correct 1 ms 468 KB Output is correct
3 Correct 1 ms 344 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 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 5 ms 604 KB Output is correct
12 Correct 5 ms 584 KB Output is correct
13 Correct 19 ms 604 KB Output is correct
14 Correct 20 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1083 ms 1116 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 5 ms 604 KB Output is correct
12 Correct 5 ms 584 KB Output is correct
13 Correct 19 ms 604 KB Output is correct
14 Correct 20 ms 348 KB Output is correct
15 Execution timed out 1083 ms 1116 KB Time limit exceeded
16 Halted 0 ms 0 KB -