C. 缺少的数字

    Type: Default 1000ms 256MiB

缺少的数字

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目背景

翻译自 CSES-1083 题。

题目描述

你得到了一个序列 1,2,,n1,2,\cdots,n,但是这个序列中恰好缺失了一个数字。你的任务就是找到那个缺失的数字。

输入格式

第一行输入一个整数 nn

第二行输入 n1n-1 个整数,输入的 n1n-1 个整数都在 [1,n][1,n] 之间,并且每个值只出现一次。

输出格式

输出一行一个整数,表示那个缺失的数字。

样例

5
2 3 1 5
4

说明/提示

2n2×1052\le n \le 2\times10^5

系统小测试

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2025-9-10 19:30
End at
2025-9-10 21:30
Duration
2 hour(s)
Host
Partic.
1