Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.224 s | 13 KBi |
#2 |
Incorrecto
|
0.221 s | 13 KBi |
#3 |
Incorrecto
|
0.225 s | 13 KBi |
#4 |
Correcto
|
0.208 s | 13 KBi |
#5 |
Correcto
|
0.219 s | 13 KBi |
#6 |
Correcto
|
0.186 s | 13 KBi |
#7 |
Correcto
|
0.388 s | 19 KBi |
#8 |
Incorrecto
|
0.325 s | 17 KBi |
#9 |
Incorrecto
|
0.404 s | 17 KBi |
#10 |
Incorrecto
|
0.354 s | 17 KBi |
#11 |
Incorrecto
|
0.322 s | 18 KBi |
#12 |
Incorrecto
|
0.328 s | 17 KBi |
#13 |
Correcto
|
0.385 s | 19 KBi |
#14 |
Incorrecto
|
0.396 s | 18 KBi |
#15 |
Correcto
|
0.363 s | 17 KBi |
#16 |
Correcto
|
0.367 s | 18 KBi |
#17 |
Incorrecto
|
0.35 s | 17 KBi |
#18 |
Incorrecto
|
0.345 s | 17 KBi |
#19 |
Incorrecto
|
0.312 s | 18 KBi |
#20 |
Correcto
|
0.32 s | 17 KBi |
#21 |
Incorrecto
|
0.328 s | 17 KBi |
#22 |
Incorrecto
|
0.308 s | 18 KBi |
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; class Main{ public static void main(String[] args) { Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in))); String s = sc.nextLine(); int largest = 0, len = s.length(); for (int i = 0; i < len; i++) { if (s.charAt(i) == s.charAt(len - i - 1)) { largest++; } else { break; } } System.out.println(largest == len ? len - 1 : largest); } }