To make matters worse

博主刚搬进新家,面对超过一千本书籍及狭小的空间,正在努力整理房间。由于暂时没有足够的书架,所有的书籍都被放在地板上,意外地形成了一种独特的“地毯”效果。当博主的姐姐看到这满地的书籍时,开玩笑地说这是她见过最漂亮的地毯。
Lesson 52 A pretty carpet
First listen and then answer the question.
What is the writer's carpet made of?
We've just moved into a new house.
And i have been working hard all morning.
I have been trying to get my new room in order.
This has not been so easy, because i own over 1000 books.
To make my work worse[To make matters worse], the room is rather small.
So i have temporarily put my books on the floor.
At the moment they cover every inch of the floor space.
And i actually have to walk on them to get in or out [of] the room.
A short while ago, my sister helped me to carry one of the[my old] book cases upstairs.
She went into my room. She got a big surprise when she saw all the books on the floor.
This is the prettiest carpet i have ever seen, she said.
She gave that[gazed it for] some time and then added, you don't need book cases at all.
You can [sit here in] your spare time and read the carpet. 
# T671331 [ZJCPC 2017] Problem Preparation ## 题目描述 It's time to prepare the problems for the $14$-th Zhejiang Provincial Collegiate Programming Contest! Almost all members of SUA programming contest problem setter team brainstorm and code day and night to catch the deadline, and empty bottles of $\textit{Marjar Cola}$ litter the floor almost everywhere! To make matters worse, one of the team member fell ill just before the deadline. So you, a brilliant student, are found by the team leader Dai to help the team check the problems' arrangement. Now you are given the difficulty score of all problems. Dai introduces you the rules of the arrangement: - The number of problems should lie between $10$ and $13$ (both inclusive). - The difficulty scores of the easiest problems (that is to say, the problems with the smallest difficulty scores) should be equal to $1$. - At least two problems should have their difficulty scores equal to $1$. - After sorting the problems by their difficulty scores in ascending order, the absolute value of the difference of the difficulty scores between two neighboring problems should be no larger than $2$. BUT, if one of the two neighboring problems is the hardest problem, there is no limitation about the difference of the difficulty scores between them. The hardest problem is the problem with the largest difficulty score. It's guaranteed that there is exactly one hardest problem. The team members have given you lots of possible arrangements. Please check whether these arrangements obey the rules or not. ## 输入格式 There are multiple test cases. The first line of the input is an integer $T$ ($1 \le T \le 10^4$), indicating the number of test cases. Then $T$ test cases follow. The first line of each test case contains one integer $n$ ($1 \le n \le 100$), indicating the number of problems. The next line contains $n$ integers $s_1, s_2, \dots, s_n$ ($-1000 \le s_i \le 1000$), indicating the difficulty score of each problem. We kindly remind you that this problem contains large I/O file, so it's recommended to use a faster I/O method. For example, you can use scanf/printf instead of cin/cout in C++. ## 输出格式 For each test case, output "Yes" (without quotes) if the arrangement follows the rules, otherwise output "No" (without quotes). ## 输入输出样例 #1 ### 输入 #1 ``` 8 9 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 11 999 1 1 2 3 4 5 6 7 8 9 11 999 1 3 5 7 9 11 13 17 19 21 10 15 1 13 17 1 7 9 5 3 11 13 1 1 1 1 1 1 1 1 1 1 1 1 2 10 2 3 4 5 6 7 8 9 10 11 10 15 1 13 3 6 5 4 7 1 14 ``` ### 输出 #1 ``` No No Yes No Yes Yes No No ``` ## 说明/提示 The first arrangement has $9$ problems only, which violates the first rule. Only one problem in the second and the fourth arrangement has a difficulty score of $1$, which violates the third rule. The easiest problem in the seventh arrangement is a problem with a difficulty score of $2$, which violates the second rule. After sorting the problems of the eighth arrangement by their difficulty scores in ascending order, we can get the sequence $\{1, 1, 3, 4, 5, 6, 7, 13, 14, 15\}$. We can easily discover that $|13-7| = 6 > 2$. As the problem with a difficulty score of $13$ is not the hardest problem (the hardest problem in this arrangement is the problem with a difficulty score of $15$), it violates the fourth rule.
最新发布
09-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值