Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define endl '\n'
- using ll = long long;
- const int N = 2e5 + 10;
- int n;
- void solve () {
- cin >> n;
- multiset<int> stl, str;
- for (int i = 1; i <= n; i ++) {
- char opt;
- int l, r;
- cin >> opt >> l >> r;
- if (opt == '+') {
- stl.insert(l);
- str.insert(r);
- }
- else {
- stl.erase(stl.find(l));
- str.erase(str.find(r));
- }
- if (stl.empty()) {
- cout << "NO\n";
- continue;
- }
- if (*stl.rbegin() > *str.begin()) cout << "YES\n";
- else cout << "NO\n";
- }
- }
- signed main () {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- int _ = 1;
- // cin >> _;
- while (_ --) {
- solve();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement