제출 #1325922

#제출 시각아이디문제언어결과실행 시간메모리
1325922djsksbrbfXORanges (eJOI19_xoranges)C++20
55 / 100
1095 ms3052 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pii; #define fi first #define se second #define pb push_back const int MOD = 1e9 + 7; const int MAX = 2e5 + 5; #define int ll signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n, q; cin >> n >> q; int a[n + 5]; for(int i = 1 ; i <= n ; i++)cin >> a[i]; while(q--){ int op, x, y; cin >> op >>x >> y; if(op == 1){ a[x] = y; } else{ int l = x, r = y; if((r - l + 1) % 2){ int ans = 0; for(int i = l ; i <= r ; i += 2){ ans ^= a[i]; } cout << ans << '\n'; } else cout << 0 << '\n'; } } return 0; }
#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...