DerreekLo's harbour
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目背景
Happybob says, "DerreekLo's-harbour!"
题目描述
现在德昱克楼港有 到 共 个位置。初始所有位置都是空的。
按顺序来了 艘船。每艘船需要 共 个位置。如果这些位置都是空的,那么该船就会停入这些位置,这些位置将不再是空的。
问:每一艘船能否填入?如果能,输出 ,否则,输出 。
输入格式
$$\begin{aligned} &n \text{ } m\\ &a_1 \text{ } b_1\\ &a_2 \text{ } b_2\\ &\dots\\ &a_m \text{ } b_m\\ \end{aligned} $$输出格式
$$\begin{aligned} &\text{Answer}_1\\ &\text{Answer}_2\\ &\dots\\ &\text{Answer}_m\\ \end{aligned} $$样例
20 3
1 17
1 20
7 17
1
0
0
数据范围
$$\begin{cases} 1 \le n, m \le 2 \times 10^3\\ 1 \le a_i \le b_i \le n\\ \end{cases} $$2025科技节水题过家家
- Status
- Done
- Rule
- IOI
- Problem
- 4
- Start at
- 2025-4-12 9:00
- End at
- 2025-4-12 11:30
- Duration
- 2.5 hour(s)
- Host
- Partic.
- 40