Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Find the missing number of a permutational series.
Missing Number
For some calculations, your math professor frequently
uses permutations. He needs a checker for his operations.
He will give you a series of numbers. And, he wants the missing
number in the permutational form of this series.
Question:
Write a program that will find the missing number
of a permutational series.
Input specification
First, you will be given an integer n where n is between
0 and 5000. Then, in the following n lines, you will
be given n-1 integers where the integers are unique
and between 1 and n
Output specification
Show one integer: the missing number.
Sample Input I
5
3
2
5
1
|
Sample Input II
7
3
5
7
1
4
6
|
Sample Output I
4
|
Sample Output II
2
|
Для отправки решений необходимо выполнить вход.
|