CF440A.Forgotten Episode

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

Polycarpus adores TV series. Right now he is ready to finish watching a season of a popular sitcom "Graph Theory". In total, the season has n episodes, numbered with integers from 1 to n.

Polycarpus watches episodes not one by one but in a random order. He has already watched all the episodes except for one. Which episode has Polycaprus forgotten to watch?

Polycarpus 非常喜欢电视剧。此刻,他正准备看完一部热门情景喜剧《图论》的整季内容。该季共有 nn 集,编号为 11 到 nn 的整数。

Polycarpus 并非按顺序一集一集地观看,而是以随机顺序观看。他已看完了除一集以外的所有剧集。那么,Polycarpus 忘记观看的是哪一集?

输入格式

The first line of the input contains integer n (2 ≤ n ≤ 100000) — the number of episodes in a season. Assume that the episodes are numbered by integers from 1 to n.

The second line contains n - 1 integer _a_1, _a_2, ..., a__n (1 ≤ a__i ≤ n) — the numbers of episodes that Polycarpus has watched. All values of a__i are distinct.

输入的第一行包含一个整数 nn(2 ≤ n ≤ 1000002 \leq n \leq 100000)—— 表示一季中的集数。假设这些剧集按整数编号,从 11 到 nn。

第二行包含 n − 1n - 1 个整数 a1, a2, ..., an−1a_1, a_2, ..., a_{n-1}(1 ≤ ai ≤ n1 \leq a_i \leq n)—— 表示 Polycarpus 已观看的剧集编号。所有 aia_i 的值互不相同。

输出格式

Print the number of the episode that Polycarpus hasn't watched.

输出 Polycarpus 未观看的剧集编号。

输入输出样例

  • 输入#1

    10
    3 8 10 1 7 9 6 5 2

    输出#1

    4

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

首页