Playing with Permutations
251B1800· expert2s256 MB⌨ stdin/stdout
Examples
Sample 1of 5
Input
4 12 3 4 11 2 3 4
Output
NO
Sample 2of 5
Input
4 14 3 1 23 4 2 1
Output
YES
Sample 3of 5
Input
4 34 3 1 23 4 2 1
Output
YES
Sample 4of 5
Input
4 24 3 1 22 1 4 3
Output
YES
Sample 5of 5
Input
4 14 3 1 22 1 4 3
Output
NO
58%
251B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)