CF1101E Polycarp's New Job
题目描述
题意简述
维护一个初始为空的点集,支持两种操作:
$+\ x\ y$:向点集中加入$(x,y)$
$?\ h\ w$:查询是否对于点集中的所有点都满足$x \leq h \&\& y \leq w$或者$x \leq w \&\& y \leq h$
输入格式
第一行一个整数$n(1 \leq n \leq 5 \times 10^5)$表示操作数
接下来$n$行每行一个操作,格式如上
数据满足$1 \leq x,y,h,w \leq 10^9$,保证至少有一个$?$操作且第一个操作一定是$+$操作
输出格式
对于每一次询问操作输出一行,如果满足条件输出```YES```,否则输出```NO```
说明/提示
The queries of type $ 2 $ of the example:
1. Neither bill fits;
2. Both bills fit (just checking that you got that bills can overlap);
3. Both bills fit (both bills are actually the same);
4. All bills fit (too much of free space in a wallet is not a problem);
5. Only bill $ 1 \times 5 $ fit (all the others don't, thus it's "NO").