CF859A.Declined Finalists

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each eligible contestant must either accept or decline the invitation. Whenever a contestant declines, the highest ranked contestant not yet invited is invited to take the place of the one that declined. This continues until 25 contestants have accepted invitations.

After the qualifying round completes, you know K of the onsite finalists, as well as their qualifying ranks (which start at 1, there are no ties). Determine the minimum possible number of contestants that declined the invitation to compete onsite in the final round.

今年,与往年一样,MemSQL 邀请资格赛(Start[c]up Qualification Round)中排名前 25 的选手赴现场参加总决赛。然而,并非所有有资格赴现场参赛的选手都能负担前往公司办公室的旅费。最初,排名前 25 的选手被邀请赴现场参赛。每位有资格参赛的选手必须选择接受或拒绝该邀请。每当一名选手拒绝邀请时,尚未收到邀请的最高排名选手将被邀请以替补该拒绝者的位置。这一过程持续进行,直至共有 25 名选手接受了邀请。

资格赛结束后,你已知其中 K 名赴现场参赛的决赛选手及其资格赛排名(排名从 1 开始,无并列情况)。请确定在总决赛现场赛邀请过程中,最少可能有多少名选手拒绝了邀请。

输入格式

The first line of input contains K (1 ≤ K ≤ 25), the number of onsite finalists you know. The second line of input contains _r_1, _r_2, ..., r__K (1 ≤ r__i ≤ 106), the qualifying ranks of the finalists you know. All these ranks are distinct.

输入的第一行包含整数 KK(1≤K≤251 \leq K \leq 25),表示你所知道的现场决赛选手人数。
输入的第二行包含 r1, r2, …, rKr_1,\,r_2,\,\dots,\,r_K(1≤ri≤1061 \leq r_i \leq 10^6),表示你所知道的各位决赛选手的晋级名次。所有这些名次互不相同。

输出格式

Print the minimum possible number of contestants that declined the invitation to compete onsite.

输出拒绝现场参赛邀请的选手的最少可能人数。

输入输出样例

  • 输入#1

    25
    2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 25 26 28

    输出#1

    3
  • 输入#2

    5
    16 23 8 15 4

    输出#2

    0
  • 输入#3

    3
    14 15 92

    输出#3

    67

说明/提示

In the first example, you know all 25 onsite finalists. The contestants who ranked 1-st, 13-th, and 27-th must have declined, so the answer is 3.

在第一个例子中,您知道全部 25 名现场决赛选手。排名为第 1 名、第 13 名和第 27 名的选手一定拒绝了邀请,因此答案是 3。

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

首页