| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 966240 | vjudge1 | XORanges (eJOI19_xoranges) | C++17 | 66 ms | 7408 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
}
}
}
컴파일 시 표준 에러 (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... | ||||
