CF1863A Channel
题目描述
Petya 是一个通信应用中一个频道的管理员。总共有 $n$ 个人订阅了他的频道,而 Petya 本身并不算作一个订阅者。
Petya 在频道上发布了一条新的帖子。在发布时,有 $a$ 个订阅者在线。我们假设如果一个订阅者在线,那他们就会阅读频道上的所有帖子。
此后,Petya 开始监测订阅者在线人数的变化。他连续收到 $q$ 个形如“一个订阅者下线了”或“一个订阅者上线了”的通知。Petya 不知道具体是哪个订阅者上下线了。保证这样的通知序列是合理存在的。
Petya 想知道是否所有订阅者都阅读了这条新帖子。请帮助他判断以下情况之一:
+ 不可能所有n个订阅者都阅读了这条新帖子;
+ 可能所有n个订阅者都阅读了这条新帖子;
+ 保证所有n个订阅者都阅读了这条新帖子。
输入格式
无
输出格式
无
说明/提示
In the first test case, there are $ 5 $ out of $ 5 $ subscribers online in the very beginning, so they will all read the post no matter what. The answer is "YES".
In the second test case, the number of subscribers online becomes $ 4 $ after the first two notifications, next someone goes offline, and thus the fifth subscriber has no chance of reading the post. It is impossible for all the subscribers to read the post, so the answer is "NO".
In the third test case, on the one hand, the same person may have gone offline and online (in this case only $ 4 $ out of $ 5 $ subscribers have read the post), on the other hand, the last notification may have told that the fifth subscriber has gone online (in this case all subscribers have read the post). We cannot deduce which of the two holds, so the answer is "MAYBE".
In the fourth test case, there have to be five subscribers online after all the notifications. All of them will read the post, so the answer is "YES".