Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.178 s | 12 KBi |
#2 |
Correcto
|
0.143 s | 16 KBi |
#3 |
Correcto
|
0.15 s | 16 KBi |
#4 |
Correcto
|
0.138 s | 15 KBi |
#5 |
Correcto
|
0.15 s | 16 KBi |
#6 |
Correcto
|
0.142 s | 15 KBi |
#7 |
Correcto
|
0.147 s | 16 KBi |
#8 |
Correcto
|
0.182 s | 12 KBi |
#9 |
Correcto
|
0.134 s | 15 KBi |
#10 |
Correcto
|
0.146 s | 16 KBi |
#11 |
Correcto
|
0.147 s | 16 KBi |
#12 |
Correcto
|
0.165 s | 16 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 = 0; boolean continuar = true; //String borde = ""; boolean finalizar = false; while (k < cadena.length() && !finalizar) { continuar=true; i=k+1; while (i < cadena.length() && !finalizar) { if (cadena.charAt(k) == cadena.charAt(i)) { finalizar=true; } i++; } k++; } if(finalizar){ System.out.println("yes"); }else{ System.out.println("no"); } } public static Scanner leer = new Scanner(System.in); }