?
# | Author | Problem | Lang | Verdict | Time | Memory | Sent | Judged | |
---|---|---|---|---|---|---|---|---|---|
112895781 |
Practice: bhanu_1005 |
1511G - 8 | C++17 (GCC 9-64) | Accepted | 4710 ms | 800 KB | 2021-04-13 09:16:55 | 2021-04-13 09:16:55 |
#pragma GCC optimize("O3") #pragma GCC target("avx2") #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, M; cin >> N >> M; vector<int> a(N); for (int i = 0; i < N; i++) cin >> a[i]; sort(a.begin(), a.end()); int Q; cin >> Q; while (Q--) { int l, r; cin >> l >> r; int L = lower_bound(a.begin(), a.end(), l) - a.begin(); int R = upper_bound(a.begin(), a.end(), r) - a.begin(); int f = 0; for (int i = L; i < R; i++) f ^= a[i] - l; cout << "AB"[f == 0]; } }
?
?
?
?