HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array_and_Matrices > problem:


50073 - Missing Number

Volume problems

• 50053 - kth Permutation
• 50057 - Parkside's Other Triangle
• 50065 - Page "Like" Ave...
• 50072 - Draw Pattern 178
• 50073 - Missing Number
• 50077 - Valid Permutations
• 50080 - Student averages
• 50090 - Row Min Subtraction
• 50099 - Snake
• 50100 - The biggest result
• 50114 - Close Pairs - Revised
• 50124 - Falling Bricks
• 50129 - Sequential Numbers

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

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



Для отправки решений необходимо выполнить вход.

www.contester.ru