#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <cmath>
#include <tuple>
using namespace std;
/*long long int power(long long int n, int k)
{
long long int vys = 1;
for (int i = 0; i < k; i++)
{
vys = (vys * (n - i)) / (i + 1);
}
return vys;
}*/
int main()
{
/*for (int i = 0; i < 10; i++)
{
std::cout << "Hello Flash!\n";
}*/
int n, q;
cin >> n >> q;
vector<int>v(n+1);
for (int i = 0; i < n; i++)
{
cin >> v[i+1];
}
while (q--)
{
int typ;
cin >> typ;
if (typ == 1)
{
int index;
int cislo;
cin >> index >> cislo;
v[index] = cislo;
}
else if (typ == 2)
{
int l;
int r;
cin >> l;
cin >> r;
int vys=0;
for (int i = 1; i <= r-l+1; i++)
{
for (int j = l; j+i-1 <= r; j++)
{
//int vys2 = v[i];
for (int k = j; k < j+i; k++)
{
vys ^= v[k];
}
}
}
cout << vys << endl;
}
}
return 0;
}
# |
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 |
6 ms |
204 KB |
Output is correct |
5 |
Correct |
6 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
639 ms |
204 KB |
Output is correct |
2 |
Correct |
555 ms |
304 KB |
Output is correct |
3 |
Correct |
742 ms |
204 KB |
Output is correct |
4 |
Execution timed out |
1084 ms |
332 KB |
Time limit exceeded |
5 |
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 |
6 ms |
204 KB |
Output is correct |
5 |
Correct |
6 ms |
204 KB |
Output is correct |
6 |
Correct |
639 ms |
204 KB |
Output is correct |
7 |
Correct |
555 ms |
304 KB |
Output is correct |
8 |
Correct |
742 ms |
204 KB |
Output is correct |
9 |
Execution timed out |
1084 ms |
332 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1078 ms |
3104 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 |
6 ms |
204 KB |
Output is correct |
5 |
Correct |
6 ms |
204 KB |
Output is correct |
6 |
Correct |
639 ms |
204 KB |
Output is correct |
7 |
Correct |
555 ms |
304 KB |
Output is correct |
8 |
Correct |
742 ms |
204 KB |
Output is correct |
9 |
Execution timed out |
1084 ms |
332 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |