# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
466773 | mtxas | XORanges (eJOI19_xoranges) | C++14 | 13 ms | 460 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define fi first
#define se second
#define pll pair<ll, ll>
#define mii map<int, int>
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define all(a) a.begin(), a.end()
#define sz(x) ((int)x.size())
#define turbo() cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false)
#define _fre() freopen("input.txt", "r", stdin)
#define _for(a, b, c) for(int (a) = (b); (a) < (c); (a)++)
#define _foreq(a, b, c) for(int (a) = (b); (a) <= (c); (a)++)
#define _forneq(a, b, c) for(int (a) = (b); (a) >= (c); (a)--)
#define _forn(a, b, c) for(int (a) = (b); (a) > (c); (a)--)
using namespace std;
/**********************************************************************************
STRUCTS
**********************************************************************************/
/**********************************************************************************
VARIABLES
**********************************************************************************/
#define int ll
const int maxn = 5001;
int a[maxn];
int t[maxn<<1];
int startIdRes[maxn];
/**********************************************************************************
FUNCTIONS
**********************************************************************************/
/**********************************************************************************
MAIN
**********************************************************************************/
signed main(){
// _fre();
turbo();
int n, q; cin>>n>>q;
_foreq(i, 1, n) cin>>a[i];
_for(g, 0, q){
int type; cin>>type;
if(type == 1){
int i, val; cin>>i>>val;
a[i] = val;
//cout<<"a["<<i<<"] = "<<val<<endl;
}
else if(type == 2){
int l, r; cin>>l>>r;
// cout<<"query("<<l<<", "<<r<<")\n";
int reply = 0;
if((l&1) == (r&1)){
_foreq(i, l, r){
if((i&1) == (l&1)) reply^= a[i];
}
}
cout<<reply<<'\n';
}
}
}
컴파일 시 표준 에러 (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... |