Submission #650310

#TimeUsernameProblemLanguageResultExecution timeMemory
650310KenparXORanges (eJOI19_xoranges)C++17
0 / 100
1085 ms5476 KiB
#include "bits/stdc++.h" using namespace std; #define ll long long #define endl '\n' const ll MOD = 1e9+7; const ll INF = 1e16; const int INT_INF = 1e9; const ll MAX = 1e6+1; void solve(){ ll n,q; cin>>n>>q; ll arr[n]; for(int i = 0; i < n; i++) cin>>arr[i]; while(q--){ ll a,b,c; cin>>a>>b>>c; if(a == 2){ b--; c--; ll ans = 0; for(int i = b; i <= c; i+=2){ ans ^= arr[i]; } cout<<ans<<endl; }else{ arr[b-1] = c; } } } int main() { cin.tie(NULL); ios::sync_with_stdio(NULL); int t = 1; //cin >> t; while(t--){ solve(); cout<<endl; } }
#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...