█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 4743

Problema 0x5c - Decir si hay una letra repetida

  • Autor: Ikerlb
  • Fecha: 2021-08-13 05:03:11 UTC (Hace más de 2 años)
Caso # Resultado Tiempo Memoria
#1
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 11, in <module>
    print(has_repeated_char(s))
  File "script.py", line 3, in has_repeated_char
    for i in map(lambda x: ord(x) - ord('a')):
TypeError: map() must have at least two arguments.
0.024 s 3 KBi
#2
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 11, in <module>
    print(has_repeated_char(s))
  File "script.py", line 3, in has_repeated_char
    for i in map(lambda x: ord(x) - ord('a')):
TypeError: map() must have at least two arguments.
0.02 s 3 KBi
#3
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 11, in <module>
    print(has_repeated_char(s))
  File "script.py", line 3, in has_repeated_char
    for i in map(lambda x: ord(x) - ord('a')):
TypeError: map() must have at least two arguments.
0.019 s 3 KBi
#4
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 11, in <module>
    print(has_repeated_char(s))
  File "script.py", line 3, in has_repeated_char
    for i in map(lambda x: ord(x) - ord('a')):
TypeError: map() must have at least two arguments.
0.027 s 6 KBi
#5
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 11, in <module>
    print(has_repeated_char(s))
  File "script.py", line 3, in has_repeated_char
    for i in map(lambda x: ord(x) - ord('a')):
TypeError: map() must have at least two arguments.
0.019 s 3 KBi
#6
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 11, in <module>
    print(has_repeated_char(s))
  File "script.py", line 3, in has_repeated_char
    for i in map(lambda x: ord(x) - ord('a')):
TypeError: map() must have at least two arguments.
0.025 s 7 KBi
#7
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 11, in <module>
    print(has_repeated_char(s))
  File "script.py", line 3, in has_repeated_char
    for i in map(lambda x: ord(x) - ord('a')):
TypeError: map() must have at least two arguments.
0.031 s 3 KBi
#8
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 11, in <module>
    print(has_repeated_char(s))
  File "script.py", line 3, in has_repeated_char
    for i in map(lambda x: ord(x) - ord('a')):
TypeError: map() must have at least two arguments.
0.035 s 3 KBi
#9
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 11, in <module>
    print(has_repeated_char(s))
  File "script.py", line 3, in has_repeated_char
    for i in map(lambda x: ord(x) - ord('a')):
TypeError: map() must have at least two arguments.
0.021 s 3 KBi
#10
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 11, in <module>
    print(has_repeated_char(s))
  File "script.py", line 3, in has_repeated_char
    for i in map(lambda x: ord(x) - ord('a')):
TypeError: map() must have at least two arguments.
0.023 s 3 KBi
#11
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 11, in <module>
    print(has_repeated_char(s))
  File "script.py", line 3, in has_repeated_char
    for i in map(lambda x: ord(x) - ord('a')):
TypeError: map() must have at least two arguments.
0.021 s 3 KBi
#12
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 11, in <module>
    print(has_repeated_char(s))
  File "script.py", line 3, in has_repeated_char
    for i in map(lambda x: ord(x) - ord('a')):
TypeError: map() must have at least two arguments.
0.02 s 3 KBi
Puntos totales: 0 / 100

Código

def has_repeated_char(s):
    d = [0] * 26
    for i in map(lambda x: ord(x) - ord('a')):
        if d[i] == 1:
            return "yes"
        d[i] += 1
    return "no"

if __name__ == "__main__":
    s = input()
    print(has_repeated_char(s))