| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 966240 | vjudge1 | XORanges (eJOI19_xoranges) | C++17 | 66 ms | 7408 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define fii(i,a,b) for(int i = a; i <= b; i++)
#define fid(i,a,b) for(int i = a; i >= b; i--)
#define ll long long
#define fi first
#define se second
#define pii pair< int, int >
#define pll pair< long long , long long >
#define sz(x) int(x.size())
#define faster ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define maxn 1000005
#define all(a) a.begin(), a.end()
#define ins insert
#define pb push_back
#define Base 13
// #define int long long
#define MOD 1000000007
#define endl '\n'
#define fill(a,n) memset(a, n, sizeof(a));
#define re return
#define name "file"
ll a[maxn];
int main(){
if(fopen(name".INP","r")){
freopen(name".INP", "r", stdin);
freopen(name".OUT", "w", stdout);
}
faster
int n, q;
cin >> n >> q;
fii(i, 1, n)
{
cin >> a[i];
}
fii(i, 1, q)
{
int t, l, u;
cin >> t >> l >> u;
if(t == 1)
{
a[l] = u;
}
else
{
if(u - l + 1 == 1)
{
cout << a[l] << endl;
}
else if(u - l + 1 == 2)
{
cout << 0 << endl;
}
else if(u - l + 1 == 3)
{
ll c = a[l] ^ a[u];
cout << c << '\n';
}
else
{
ll c = a[l] ^ a[l + 1];
ll d = a[u] ^ a[u - 1];
ll ans = c ^ d;
cout << ans << endl;
}
}
}
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
