Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.171 s | 12 KBi |
#2 |
Correcto
|
0.12 s | 14 KBi |
#3 |
Correcto
|
0.17 s | 12 KBi |
#4 |
Correcto
|
0.175 s | 29 KBi |
#5 |
Correcto
|
0.163 s | 12 KBi |
#6 |
Correcto
|
0.121 s | 13 KBi |
#7 |
Correcto
|
0.115 s | 52 KBi |
#8 |
Correcto
|
0.127 s | 13 KBi |
#9 |
Correcto
|
0.157 s | 12 KBi |
#10 |
Correcto
|
0.136 s | 13 KBi |
#11 |
Correcto
|
0.196 s | 15 KBi |
#12 |
Correcto
|
0.13 s | 55 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String word = sc.nextLine(); int size = word.length(); int counter = 0; for (int i = 0; i < size; i++) { for (int j = i + 1; j < size; j++) { if (word.charAt(i) == word.charAt(j)) { counter = 1; break; } } if (counter == 1) break; } sc.close(); if (counter == 1) { System.out.println("yes"); } else { System.out.println("no"); } } }