QOJ.ac

QOJ

时间限制: 1 s 内存限制: 1024 MB 总分: 100

#4674. 许多任务

统计

Bytica 是 Byteotian 大公司的一名高管,她有很多任务要做。

她总共有 $n$ 个任务,第 $i$ 个任务需要的时间范围是 $[l_i, r_i]$(包含端点)。注意 $r_i - l_i$ 是一个偶数,且这些时间范围可以以任何方式重叠。

Bytica 决定简化工作——对于每个任务,她将选择原时间范围的前半段或后半段。但她不喜欢生活发生太大的改变,因此对于她在减半之前忙碌的每一个时刻,她希望在减半之后该时刻依然忙碌。

如果 Bytica 在某个时刻至少有一个任务要做,则认为她处于忙碌状态。

你的任务是判断 Bytica 是否能够简化她的生活。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 200$),表示任务的数量。接下来的 $n$ 行描述每个时间范围 $[l_i, r_i]$ ($0 \le l_i < r_i \le 10^9$,$r_i - l_i$ 为偶数),这些数值均为整数。

输出格式

如果答案为肯定,则输出一行 “YES”,否则输出 “NO”。

样例

样例输入 1

4
1 9
5 13
11 13
6 12

样例输出 1

YES

样例输入 2

3
46 76
0 2
45 75

样例输出 2

NO

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.