Submission #929229

# Submission time Handle Problem Language Result Execution time Memory
929229 2024-02-18T03:37:56 Z bambaa XORanges (eJOI19_xoranges) C++14
0 / 100
435 ms 7868 KB
#include <bits/stdc++.h>
#include <iostream>
#include <set>
#include <cmath>
#include <iterator>
#include <vector>
 
#define ff first
#define ss second
#define mp make_pair 
#define ll long long
 
using namespace std;
int main() {

	int n, q;
	cin >> n >> q;
	int a[n];
	for (int i = 0; i < n; i++){
	 	cin >> a[i];
	}
	for (int lol = 0; lol < q; lol++){
		int x, y, z;
	 	cin >> x >> y >> z;
	 	if (x == 1) {a[y - 1] = z;}
	 	else {
	 		if (z == y) cout << a[y - 1] << endl;
	 		if (z - y == 1) cout << "0" << endl;
	 		if (z - y == 2) cout << (a[y - 1] ^ a[z - 1]) << endl;
	 		if (z - y >= 3) cout << (((a[y - 1] ^ a[y]) ^ a[z - 2]) ^ a[z - 1]) << endl;
	 	}
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 435 ms 7868 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -