"CF Brief Introduction"
Submit Link: Http://codeforces.com/contest/560/problem/A
Surface:
A. Currency System in Geraldiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard Inputoutputstan Dard output
A Magic Island Geraldion, where Gerald lives, have its own currency system. It uses banknotes of several values. But the problem is, the system isn't perfect and sometimes it happens that Geraldionians cannot express a certain sum of Money with any set of banknotes. Of course, they can use any number of banknotes for each value. Such sum is calledunfortunate. Gerald Wondered:what is the minimumunfortunate sum?
Input
The first line contains number n (1?≤? N. ≤?1000)-the number of values of the banknotes that used in geraldion.
The second line contains n distinct space-separated numbersa1,? A2,?...,? An (1?≤? ) Ai? ≤?106)-the values of the banknotes.
Output
Print a single line-the minimum unfortunate sum. If There is no unfortunate sums, print?-? 1.
Sample Test (s) Input
51 2 3) 4 5
Output
-1
--------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------
Problem solving: See if there is No 1, No 1 is absolutely not 1. Be able to sweep through, make a mark, see whether 1 has appeared. Hack had one. He encountered 1 to stop typing, but I hack failed, because the system only to award out files ....
"Play CF, learn algorithm--one star" Codeforces Round #313 (Div. 2) A. Currency System in Geraldion