Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.006 s | 1 KBi |
#2 |
Correcto
|
0.005 s | 2 KBi |
#3 |
Correcto
|
0.004 s | 1 KBi |
#4 |
Correcto
|
0.006 s | 1 KBi |
#5 |
Correcto
|
0.006 s | 1 KBi |
#6 |
Correcto
|
0.004 s | 1 KBi |
#7 |
Correcto
|
0.004 s | 1 KBi |
#8 |
Correcto
|
0.005 s | 1 KBi |
#9 |
Correcto
|
0.005 s | 26 KBi |
#10 |
Correcto
|
0.005 s | 3 KBi |
#11 |
Correcto
|
0.005 s | 1 KBi |
#12 |
Correcto
|
0.004 s | 16 KBi |
#include <stdio.h> #include <stdlib.h> int main() { size_t bytes_read = 0, len = 0, i; char *s = NULL, *hashtable = NULL; bytes_read = getline(&s, &len, stdin); hashtable = malloc(bytes_read - 1); for(i = 0; s[i] != '\0'; i++) { if(hashtable[s[i] % bytes_read] == s[i]) { printf("yes"); free(s); free(hashtable); return 0; } hashtable[s[i] % bytes_read] = s[i]; } printf("no"); free(s); free(hashtable); return 0; }