Submission #236870

#TimeUsernameProblemLanguageResultExecution timeMemory
236870EJOI2019AndrewXORanges (eJOI19_xoranges)C++14
0 / 100
1078 ms1844 KiB
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,q; cin>>n>>q; int arr[n]; for(int i=0; i<n; ++i) cin>>arr[i]; for(int i=0; i<q; ++i) { int type; cin>>type; if(type==1) { int x,y; cin>>x>>y; --x; arr[x]=y; } else { int x,y; cin>>x>>y; --x; --y; int ans(0); for(int j=x; j<=y; ++j) { int freq=(j-x+1)*(n-(j-x)); if(freq%2) ans^=arr[j]; } cout<<ans<<"\n"; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...