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

Envío 4899

Problema 0x7b - Mínimo número de salones para acomodar todas las clases

  • Autor: bryancalisto
  • Fecha: 2021-09-12 17:12:03 UTC (Hace más de 2 años)
Caso # Resultado Tiempo Memoria
#1
Correcto
0.053 s 3 KBi
#2
Correcto
0.043 s 3 KBi
#3
Incorrecto
0.023 s 3 KBi
#4
Correcto
0.035 s 6 KBi
#5
Correcto
0.023 s 3 KBi
#6
Correcto
0.021 s 3 KBi
#7
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 20, in <module>
    table[startEnd[1] + 1] -= 1
IndexError: list index out of range
0.053 s 3 KBi
#8
Incorrecto
0.069 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 20, in <module>
    table[startEnd[1] + 1] -= 1
IndexError: list index out of range
0.053 s 3 KBi
#10
Correcto
0.033 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 20, in <module>
    table[startEnd[1] + 1] -= 1
IndexError: list index out of range
0.047 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 20, in <module>
    table[startEnd[1] + 1] -= 1
IndexError: list index out of range
0.03 s 3 KBi
#13
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 20, in <module>
    table[startEnd[1] + 1] -= 1
IndexError: list index out of range
0.048 s 3 KBi
#14
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 20, in <module>
    table[startEnd[1] + 1] -= 1
IndexError: list index out of range
0.018 s 3 KBi
#15
Error en tiempo de ejecución (NZEC)
Exited with error status 1
Traceback (most recent call last):
  File "script.py", line 20, in <module>
    table[startEnd[1] + 1] -= 1
IndexError: list index out of range
0.043 s 3 KBi
Puntos totales: 40 / 100

Código

def toMinutesArray(times: str):
    res = [0, 0]
    startEnd = times.split()
    hourMin = startEnd[0].split(':')
    res[0] = int(hourMin[0]) * 60 + int(hourMin[1])
    hourMin = startEnd[1].split(':')
    res[1] = int(hourMin[0]) * 60 + int(hourMin[1])
    return res


MAX_MINS = 1439

N = int(input())
table = [0] * MAX_MINS
res = table[0]

for i in range(N):
    startEnd = toMinutesArray(input())
    table[startEnd[0]] += 1
    table[startEnd[1] + 1] -= 1

sum = 0
res = 0
for i in range(1, MAX_MINS):
    table[i] += table[i-1]
    res = max(res, table[i])

print(res)