CF1284D.New Year and Conference
提高+/省选-
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Filled with optimism, Hyunuk will host a conference about how great this new year will be!
The conference will have n lectures. Hyunuk has two candidate venues a and b. For each of the n lectures, the speaker specified two time intervals [sai,eai] (sai≤eai) and [sbi,ebi] (sbi≤ebi). If the conference is situated in venue a, the lecture will be held from sai to eai, and if the conference is situated in venue b, the lecture will be held from sbi to ebi. Hyunuk will choose one of these venues and all lectures will be held at that venue.
Two lectures are said to overlap if they share any point in time in common. Formally, a lecture held in interval [x,y] overlaps with a lecture held in interval [u,v] if and only if max(x,u)≤min(y,v).
We say that a participant can attend a subset s of the lectures if the lectures in s do not pairwise overlap (i.e. no two lectures overlap). Note that the possibility of attending may depend on whether Hyunuk selected venue a or venue b to hold the conference.
A subset of lectures s is said to be venue-sensitive if, for one of the venues, the participant can attend s, but for the other venue, the participant cannot attend s.
A venue-sensitive set is problematic for a participant who is interested in attending the lectures in s because the participant cannot be sure whether the lecture times will overlap. Hyunuk will be happy if and only if there are no venue-sensitive sets. Determine whether Hyunuk will be happy.
满怀乐观,玄旭将举办一场关于新年多么美好的会议!
会议将包含 n 场讲座。玄旭有两个候选会场 a 和 b。对于这 n 场讲座中的每一场,主讲人分别指定了两个时间区间:[sai,eai](其中 sai≤eai)和 [sbi,ebi](其中 sbi≤ebi)。若会议在会场 a 举行,则该讲座的时间为 [sai,eai];若会议在会场 b 举行,则该讲座的时间为 [sbi,ebi]。玄旭将从这两个会场中选择一个,且所有讲座均在所选会场举行。
若两场讲座在时间上存在任意公共点,则称它们重叠。形式化地,一场在区间 [x,y] 举行的讲座与另一场在区间 [u,v] 举行的讲座重叠,当且仅当 max(x,u)≤min(y,v)。
我们称一名参与者能够参加讲座的一个子集 s,当且仅当 s 中的讲座两两不重叠(即任意两场讲座均不重叠)。注意,能否参加该子集可能取决于玄旭选择的是会场 a 还是会场 b。
若一个讲座子集 s 满足:对其中一个会场,参与者能够参加 s;而对另一个会场,参与者无法参加 s,则称 s 是会场敏感的(venue-sensitive)。
一个会场敏感的集合对希望参加 s 中所有讲座的参与者而言是成问题的,因为该参与者无法确定这些讲座的时间是否会重叠。当且仅当不存在任何会场敏感的集合时,玄旭才会感到高兴。请判断玄旭是否会感到高兴。
输入格式
The first line contains an integer n (1≤n≤100000), the number of lectures held in the conference.
Each of the next n lines contains four integers sai, eai, sbi, ebi (1≤sai,eai,sbi,ebi≤109, sai≤eai,sbi≤ebi).
第一行包含一个整数 n(1≤n≤100000),表示会议中举办的讲座数量。
接下来的 n 行,每行包含四个整数 sai、eai、sbi、ebi(1≤sai,eai,sbi,ebi≤109,且 sai≤eai,sbi≤ebi)。
输出格式
Print "YES" if Hyunuk will be happy. Print "NO" otherwise.
You can print each letter in any case (upper or lower).
如果Hyunuk会感到开心,则输出 "YES";否则输出 "NO"。
您可以以任意大小写(大写或小写)输出每个字母。
输入输出样例
输入#1
2 1 2 3 6 3 4 7 8
输出#1
YES
输入#2
3 1 3 2 4 4 5 6 7 3 4 5 5
输出#2
NO
输入#3
6 1 5 2 9 2 4 5 8 3 6 7 11 7 10 12 16 8 11 13 17 9 12 14 18
输出#3
YES
说明/提示
In second example, lecture set 1,3 is venue-sensitive. Because participant can't attend this lectures in venue a, but can attend in venue b.
In first and third example, venue-sensitive set does not exist.
在第二个例子中,讲座集合 {1,3} 是场地敏感的。因为参与者无法在场地 a 参加这些讲座,但可以在场地 b 参加。
在第一个和第三个例子中,不存在场地敏感集合。
输入解题思路,AI测评打分。不知道怎么写?