Public submissions
Source code of every submission to this problem in this contest
will be visible for everyone since 20131213 17:19:31.
Submit  All submissions  Best solutions  Back to list 
SMPSEQ7  Fun with Sequences (Act 5) 
You are given S  a sequence of n integers S = s_{1}, s_{2}, ..., s_{n}. Please, compute if it is possible to split S into two parts: s_{1}, s_{2}, ..., s_{i} and s_{i+1}, s_{i+2}, ..., s_{n} (1 <= i < n) in such a way that the first part is strictly decreasing while the second is strictly increasing one.
Input data specification
In the first line you are given an integer 2<=n<=100
and in the following line n integers
100 <= s_{i} <= 100.
Output data specification
One word Yes or No.
Example 1
Input: 5 1 2 1 1 1 Output: No
Example 2
Input: 6 3 1 2 2 1 3 Output: Yes
Example 3
Input: 6 2 2 1 0 1 2 Output: No
Added by:  kuszi 
Date:  20131212 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Public source code since:  20131213 17:19:31 
hide comments


20150808 09:16:12 kuszi
for a test 2 1 2 output is "Yes" (i=1) 

20150807 11:10:54
what will be output for this? 2 1 2 

20150507 18:51:39 kuszi
@lopiavodsky In both cases the answer is "Yes". For example you can split "9 8 7"  "6" and "6"  "7 8 9". 

20150507 18:47:16 kuszi
@prodigy_coder If you are asking for the submissions of other users then: "all submissions" (from the top menu) and clicking the particular submission ID gives the code. 

20150507 07:21:45 prodigy_coder
Is there a way to see the codes of other submissions? How do u do it? 

20150128 08:13:12 lopiavodsky
what about 9 8 7 6 or 6 7 8 9( all are ascending order or discending order?) Are they true? 

20141106 09:08:35 astrolion
WA test4... @Ćukasz Kuszner Last edit: 20141106 09:21:25 

20141007 21:40:02 kuszi
@Yugratna Srivastava "strictly decreasing" means that the element is less than the previous one. Given 8 5 4 4 4 2 3 1 the anwser is "No". Last edit: 20141007 21:40:55 

20141007 14:08:20 Yugratna Srivastava
In example 3, 2 2 1 0 1 2 : the first part must be descending, so can it not be with single element which is repeated? taking 2 2 1 as descending and 0 1 2 as ascending? My code executes on my system, but here it does not. And what output should 8 5 4 4 4 2 3 1 give? 