3161.Forgotten Episode

Time Limit: 1s Memory Limit: 256MB

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?

Input Format(From the terminal/stdin)

The first line of the input contains integer n (2 \le n \le 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 a1,a2,...,an (1 \le ai \le n)- the numbers of episodes that Polycarpus has watched. All values of ai are distinct.

Output Format(To the terminal/stdout)

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

Sample Input

Copy
10
3 8 10 1 7 9 6 5 2
  \n
 · ·  · · · · · · \n

Sample Output

Copy
4
 \n

Submit

请先 登录

© 2025 FAQs