A9411 | Data Recovery
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Not so long ago company R2 bought company R1 and consequently, all its developments in the field of multicore processors. Now the R2 laboratory is testing one of the R1 processors.
The testing goes in $n$ steps, at each step the processor gets some instructions, and then its temperature is measured. The head engineer in R2 is keeping a report record on the work of the processor: he writes down the minimum and the maximum measured temperature in his notebook. His assistant had to write down all temperatures into his notebook, but (for unknown reasons) he recorded only $m$ .
The next day, the engineer's assistant filed in a report with all the $m$ temperatures. However, the chief engineer doubts that the assistant wrote down everything correctly (naturally, the chief engineer doesn't doubt his notes). So he asked you to help him. Given numbers $n$ , $m$ , $min$ , $max$ and the list of $m$ temperatures determine whether you can upgrade the set of $m$ temperatures to the set of $n$ temperatures (that is add $n-m$ temperatures), so that the minimum temperature was $min$ and the maximum one was $max$ .
The testing goes in $n$ steps, at each step the processor gets some instructions, and then its temperature is measured. The head engineer in R2 is keeping a report record on the work of the processor: he writes down the minimum and the maximum measured temperature in his notebook. His assistant had to write down all temperatures into his notebook, but (for unknown reasons) he recorded only $m$ .
The next day, the engineer's assistant filed in a report with all the $m$ temperatures. However, the chief engineer doubts that the assistant wrote down everything correctly (naturally, the chief engineer doesn't doubt his notes). So he asked you to help him. Given numbers $n$ , $m$ , $min$ , $max$ and the list of $m$ temperatures determine whether you can upgrade the set of $m$ temperatures to the set of $n$ temperatures (that is add $n-m$ temperatures), so that the minimum temperature was $min$ and the maximum one was $max$ .
输入格式
The first line contains four integers $n,m,min,max$ $(1<=m<n<=100; 1<=min<max<=100)$ . The second line contains $m$ space-separated integers $t_{i}$ $(1<=t_{i}<=100)$ — the temperatures reported by the assistant.
Note, that the reported temperatures, and the temperatures you want to add can contain equal temperatures.
Note, that the reported temperatures, and the temperatures you want to add can contain equal temperatures.
输出格式
If the data is consistent, print 'Correct' (without the quotes). Otherwise, print 'Incorrect' (without the quotes).
输入输出样例
输入 #1
2 1 1 2 1
输出 #1
Correct
输入 #2
3 1 1 3 2
输出 #2
Correct
输入 #3
2 1 1 3 2
输出 #3
Incorrect
In the first test sample one of the possible initial configurations of temperatures is \[1, 2\].
In the second test sample one of the possible initial configurations of temperatures is \[2, 1, 3\].
In the third test sample it is impossible to add one temperature to obtain the minimum equal to 1 and the maximum equal to 3.
In the second test sample one of the possible initial configurations of temperatures is \[2, 1, 3\].
In the third test sample it is impossible to add one temperature to obtain the minimum equal to 1 and the maximum equal to 3.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted