Concert
InterviewTime limit1sMemory limit512 MB
Given up to one million first-round ticket numbers, find the smallest positive integer not among them.
- Level
Easy3 of 10
- Topics
- Sorting, Implementation
- Solved
- No attempts yet
Problem
HCPC (Hanyang Completely Perfect Celebrity) is the title given to the best singer at Hanyang University. Hanyang University selects the best HCPC every year. Becoming an HCPC is far from easy. Every morning they peel and swallow a raw egg, wear a scarf even in summer to protect their throat, and usually do not speak a single word, all to take care of their throat. It is said that even a person with dull, hard-of-hearing ears becomes sharp-eared, clear-headed, and wise, and realizes the truths of life, after hearing just one phrase of an HCPC's song.
To give Hanyang students a chance to hear the voice of such an HCPC, Hanyang University holds an HCPC concert every year. Ticketing for the HCPC concert is fiercely competitive, and ticketing takes place in two rounds. The smaller the ticket number, the closer you can hear the HCPC's voice.
Yanghani missed the first round of ticketing for the HCPC concert and challenges the second round. Yanghani obtained very special information: the list of ticket numbers already sold in the first round of ticketing. Ticket numbers start from 1.
Yanghani wants to know the smallest ticket number among the tickets excluding those with numbers in this list. Help Yanghani!
Input
The first line gives an integer , the number of tickets sold in the first round of ticketing. ()
The second line gives the integers , the numbers of the tickets sold in the first round of ticketing. ()
Output
Print the smallest number among the tickets Yanghani can get in the second round of ticketing.