Capicua


Submit solution

Points: 10
Time limit: 5.0s
Memory limit: 256M

Author:
Problem types
Allowed languages
C#, Go, Java

Donada una seqüència de números, dir si és capicua.

Input Format

El primer número indica la quantitat de números que hi ha en la seqüència. A continuació ve la seqüència.

Constraints

-

Output Format

"SI" si la seqüència és capicua. "NO" si no ho és.

Sample Input 0

5    100 200 300 200 100

Sample Output 0

SI

Sample Input 1

6    100 200 300 300 200 100

Sample Output 1

SI

Sample Input 2

1    100

Sample Output 2

SI

Sample Input 3

2    100 100

Sample Output 3

SI

Sample Input 4

4    100 100 200 100

Sample Output 4

NO

Sample Input 5

3    100 100 200

Sample Output 5

NO

Sample Input 6

20    1 2 3 4 5 6 7 8 9 10 10 9 8 7 6 5 4 3 2 1

Sample Output 6

SI

Sample Input 7

7
1 2 3 4 3 90 1

Sample Output 7

NO

Sample Input 8

6
1 2 3 3 90 1

Sample Output 8

NO

Autoria: Gerard Falcó


Authorship: Gerard Falcó

CC BY-NC-SA 4.0