제출 #1099438

#제출 시각아이디문제언어결과실행 시간메모리
1099438vjudge1XORanges (eJOI19_xoranges)C++17
12 / 100
1057 ms1880 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { int n, q; cin >> n >> q; vector<int> a(n + 1); for (int i = 1; i <= n; i++){ cin >> a[i]; } while(q--){ int t, l, u; cin >> t >> l >> u; int x = 0; if (t == 2){ if ((u - l + 1) % 2 == 0){ cout << 0 << endl; }else{ for (int i = 1; i <= u - l + 1; i++){ //cout << i << endl; for (int j = l; j <= u - i + 1; j++){ //cout << "j:::::" << j << endl; for (int k = j; k <= j + i - 1; k++){ x ^= a[k]; } } } cout << x << endl; } }else{ a[l] = u; } } }
#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...