#B. Missing Number-CSES Introductory Problems

    Type: FileIO (miss) 1000ms 256MiB

Missing Number-CSES Introductory Problems

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.

Description

You are given all numbers between 1, 2,...,n except one. Your task is to find the missing number.

Format

Input

The first input line contains an integer n.

The second line contains n - 1 numbers. Each number is distinct and between 1 and n (inclusive).

Output

Print the missing number.

Samples

5
2 3 1 5
4

Limitation

  • 2n2 * 10^5
  • Time limit: 1.00 s
  • Memory limit: 512 MB

"云滇计划"基础班-乐多赛

Not Attended
Status
Done
Rule
Ledo
Problem
11
Start at
2026-7-27 19:00
End at
2026-7-27 21:00
Duration
2 hour(s)
Host
Partic.
6