CF413A.Data Recovery

普及-

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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.

不久之前,R2 公司收购了 R1 公司,从而获得了其在多核处理器领域的所有研发成果。目前,R2 实验室正在测试 R1 的一款处理器。

测试共分为 nn 个步骤,每一步中处理器接收若干指令,随后测量其温度。R2 公司的首席工程师会记录处理器运行过程中的温度报告:他在笔记本上记下所测得的最低温度和最高温度。而他的助手本应将每一次测得的温度全部记录下来,但(出于未知原因)仅记录了其中 mm 个。

次日,助手提交了一份报告,其中包含了这 mm 个温度值。然而,首席工程师怀疑助手是否准确无误地完成了全部记录工作(当然,首席工程师对自己所记的最小值与最大值毫不怀疑)。因此,他请你协助验证:已知数字 nn、mm、min\text{min}、max\text{max} 以及这 mm 个温度值的列表,请判断能否将这 mm 个温度值扩充为 nn 个温度值(即额外添加 n−mn - m 个温度值),使得扩充后全部 nn 个温度值的最小值恰好为 min\text{min},且最大值恰好为 max\text{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.

第一行包含四个整数 nn、mm、min\text{min}、max\text{max}(满足 1≤m<n≤1001 \le m < n \le 100;1≤min<max≤1001 \le \text{min} < \text{max} \le 100)。
第二行包含 mm 个用空格分隔的整数 tit_i(1≤ti≤1001 \le t_i \le 100)——即助手报告的温度值。

注意:报告的温度值以及你将要添加的温度值可以包含相等的温度。

输出格式

If the data is consistent, print 'Correct' (without the quotes). Otherwise, print 'Incorrect' (without the quotes).

如果数据一致,输出“Correct”(不带引号);否则,输出“Incorrect”(不带引号)。

输入输出样例

  • 输入#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.

在第一个测试样例中,一种可能的初始温度配置为 [1, 2]。

在第二个测试样例中,一种可能的初始温度配置为 [2, 1, 3]。

在第三个测试样例中,无法通过添加一个温度值使得最小值等于 1 且最大值等于 3。

输入解题思路,AI测评打分。不知道怎么写?

首页