HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


50407 - Missing Number

Guest
• Review clarifications (1)

Volume problems

• 50413 - Valid Permutations
• 50406 - Draw Pattern 178
• 50861 - The largest Student Group
• 50418 - Student averages
• 50420 - Teachers Sightseeing
• 50384 - Permutations revisited
• 50841 - My grand-grand-grandfather
• 50395 - Page "Like" Averages
• 50407 - Missing Number
• 50516 - Lines
• 50446 - Snake
• 50875 - Take m-out
• 50509 - Reading Book
• 50529 - Row to Table
• 50786 - Top Question
• 50788 - Eight Puzzle
• 50499 - Table to Row

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