ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Алгоритмы и Структуры Данных > задача:


11. Missing Number

Задачи сборника

• 06. Премьер-министр
• 02. Футбол
• 04. Баскетбольная команда
• 07. B. Влюбленная Duff
• 08. B. Песня о любви
• 09. Weird Algorithm
• 10. А. Любовь «А»
• 11. Missing Number
• 12. D. Love-Hate
• 13. Repetitions
• 14. Increasing Array
• 15. Bit Strings
• 16. Josephus Queries
• 18. Apartments
• 19. Ferris Wheel
• 20. Two Sets

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Сложность Альфа


You are given all numbers between 1,2,…,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≤n≤2⋅105

Example
Input:
5
2 3 1 5

Output:
4

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

www.contester.ru