이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
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 i=0; i<q; ++i)
{
int type;
cin>>type;
if(type==1)
{
int pos,val;
cin>>pos>>val;
a[pos-1]=val;
}
else
{
int from,to;
cin>>from>>to;
--from;
--to;
int ans(0);
for(int i=from; i<=to; ++i)
{
int freq=(i+1-from)*(to-from+1-i-from);
if(freq%2)
ans^=a[i];
}
cout<<ans<<'\n';
}
}
return 0;
}
# | 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... |