Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.176 s | 17 KBi |
#2 |
Incorrecto
|
0.175 s | 16 KBi |
#3 |
Incorrecto
|
0.178 s | 16 KBi |
#4 |
Incorrecto
|
0.193 s | 16 KBi |
#5 |
Correcto
|
0.183 s | 12 KBi |
#6 |
Correcto
|
0.14 s | 15 KBi |
#7 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.554 s | 125 KBi |
#8 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.814 s | 125 KBi |
#9 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.847 s | 125 KBi |
#10 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.512 s | 125 KBi |
#11 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.526 s | 125 KBi |
#12 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.528 s | 125 KBi |
#13 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.485 s | 125 KBi |
#14 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.532 s | 125 KBi |
#15 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.492 s | 125 KBi |
#16 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.534 s | 125 KBi |
#17 |
Error en tiempo de ejecución (NZEC)
Exited with error status 137 run: line 1: 3 Killed /usr/local/openjdk13/bin/java Main |
0.585 s | 125 KBi |
#18 |
Incorrecto
|
0.389 s | 21 KBi |
#19 |
Incorrecto
|
0.551 s | 21 KBi |
#20 |
Correcto
|
0.412 s | 21 KBi |
#21 |
Incorrecto
|
0.387 s | 20 KBi |
#22 |
Incorrecto
|
0.409 s | 20 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { //input dimensiones String cadena = leer.nextLine().trim(); int count = 0; int i = 0; int k = 1; boolean continuar = true; String borde = ""; boolean finalizar = false; while (k < cadena.length()-1 && !finalizar) { i=0; continuar=true; while (i < cadena.length() - k && continuar) { if (cadena.charAt(i) == cadena.charAt(i + k)) { count++; borde += cadena.charAt(i); } else { continuar = false; count=0; borde=""; } i++; } if (continuar) { finalizar = true; } k++; } System.out.println(count); System.out.println(borde); } public static Scanner leer = new Scanner(System.in); }