-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathin_love(multiset).cpp
More file actions
51 lines (44 loc) · 1.34 KB
/
in_love(multiset).cpp
File metadata and controls
51 lines (44 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include<bits/stdc++.h>
using namespace std;
#define faster_ayman ios_base::sync_with_stdio(false);cin.tie(NULL);
#define int long long
#define pb push_back
#define rep(i, a, b) for (auto i = a; i < b; i++)
#define all(a) (a).begin(), (a).end()
#define testcase int tt;cin >> tt;while (tt--)
#define inf 1e18
typedef vector<int> vi;
typedef vector<pair<int,int>> vp;
typedef vector<double> vd;
typedef vector<char> vc;
typedef set<int> si;
typedef set<char> sc;
typedef unordered_set<int> usi;
signed main() {
faster_ayman
int q; cin >> q;
multiset<int>l , r;
rep (i, 0, q) {
int x, y;
char s; cin >> s >> x >> y;
if (s == '+') {
l.insert(x);
r.insert(y);
}else {
l.erase(l.find(x));
r.erase(r.find(y));
}
if (l.size() <= 1) {
cout << "NO\n";
continue;
}
int max_left = *l.rbegin();
int min_right = *r.begin();
if (max_left > min_right) {
cout << "YES\n";
}else {
cout << "NO\n";
}
}
return 0;
}