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

Envío 1667

Problema 0x25 - Suma de un subarreglo grande

Caso # Resultado Tiempo Memoria
#1
Incorrecto
0.023 s 3 KBi
#2
Incorrecto
0.028 s 3 KBi
#3
Incorrecto
0.027 s 3 KBi
#4
Incorrecto
0.028 s 3 KBi
#5
Incorrecto
0.022 s 3 KBi
#6
Incorrecto
0.031 s 3 KBi
#7
Incorrecto
0.03 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(subarray)
OSError: [Errno 27] File too large
0.301 s 8 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(subarray)
OSError: [Errno 27] File too large
0.244 s 11 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(subarray)
OSError: [Errno 27] File too large
0.247 s 12 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(subarray)
OSError: [Errno 27] File too large
0.266 s 12 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(subarray)
OSError: [Errno 27] File too large
0.283 s 12 KBi
#13
Incorrecto
0.613 s 9 KBi
#14
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(subarray)
OSError: [Errno 27] File too large
0.226 s 11 KBi
Puntos totales: 0 / 100

Código

input()
array = [int(n) for n in input().split()]
casos = int(input())

for _ in range(casos):
    suma = 0
    caso = input().split()
    p = int(caso[0])
    q = int(caso[1])
    subarray = array[p:q+1]
    print(subarray)
    for elemento in subarray:
        suma += elemento
    print(suma)