CSES - Missing Number | Số còn thiếu

View as PDF



Authors:
Problem types
Points: 800 (p) Time limit: 1.0s Memory limit: 512M Input: stdin Output: stdout

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

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.

Constraints

  • \(2 \leq n \leq 2\cdot10^5\)

Example

Sample input

5  
2 3 1 5

Sample output

4


Comments (14)

Most recent
Loading comments...