#D. DerreekLo's harbour

    Type: Default 1000ms 256MiB

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!"

题目描述

现在德昱克楼港有 11nnnn 个位置。初始所有位置都是空的。

按顺序来了 mm 艘船。每艘船需要 [ai,bi][a_i, b_i]biai+1b_i - a_i + 1 个位置。如果这些位置都是空的,那么该船就会停入这些位置,这些位置将不再是空的。

问:每一艘船能否填入?如果能,输出 11,否则,输出 00

输入格式

$$\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科技节水题过家家

Not Attended
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