Supergirl to the Rescue
All submissions for this problem are available.
Supergirl was having her favorite cheese pasta when she gets the news that Lex Luther has kidnapped the prime minister of the states.Luther kept him in a life support system which will explode in some hours. To come out of that system, supergirl needs to unlock the password but it has certain rules.
The rules are as follows: She needs to unlock the password but it has a game which is to be played in pairs. So, she calls all the Avengers and they reach there within seconds.Now each pair of a team has to collect pebbles(from outside the life support system). The pairs are standing in a queue.The rule is if the first person of the pair collects k number of pebbles then the next one has to collect more than k pebbles and thus the number of pebbles must be pairwise sorted.
First line of input contains total number of Avengers, N. The next line contains pebbles each avenger is having.
Output "Yes" (without quotes) if they will be able to get the prime minister out of that system and "No" (without quotes) if not.
1 ≤ N ≤ 100
Input: 6 10 12 10 13 1 5
Output: Yes Explanation:
In the pairs (10,12),(10 13),(1 5) the second person collected more number of pebbles than the first one.
Therefore the output is "Yes".
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, CS2, PAS fpc, PAS gpc, GO, NODEJS, HASK, D, PERL, FORT, ADA, CAML, ICK, BF, ASM, CLPS, ICON, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, JS, ERL, kotlin, PERL6, CLOJ, COB, FS|
Fetching successful submissions