Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.025 s | 3 KBi |
#2 |
Correcto
|
0.025 s | 3 KBi |
#3 |
Correcto
|
0.034 s | 3 KBi |
#4 |
Correcto
|
0.029 s | 3 KBi |
#5 |
Correcto
|
0.024 s | 3 KBi |
#6 |
Correcto
|
0.027 s | 3 KBi |
#7 |
Correcto
|
0.025 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 29, in <module> print(suma_num(primera, ultima, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) [Previous line repeated 995 more times] File "script.py", line 15, in suma_num if primera < ultima: RecursionError: maximum recursion depth exceeded in comparison |
0.087 s | 6 KBi |
#9 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 29, in <module> print(suma_num(primera, ultima, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) [Previous line repeated 995 more times] File "script.py", line 15, in suma_num if primera < ultima: RecursionError: maximum recursion depth exceeded in comparison |
0.274 s | 15 KBi |
#10 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 29, in <module> print(suma_num(primera, ultima, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) [Previous line repeated 995 more times] File "script.py", line 15, in suma_num if primera < ultima: RecursionError: maximum recursion depth exceeded in comparison |
0.26 s | 15 KBi |
#11 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 29, in <module> print(suma_num(primera, ultima, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) [Previous line repeated 995 more times] File "script.py", line 15, in suma_num if primera < ultima: RecursionError: maximum recursion depth exceeded in comparison |
0.328 s | 15 KBi |
#12 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 29, in <module> print(suma_num(primera, ultima, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) [Previous line repeated 995 more times] File "script.py", line 15, in suma_num if primera < ultima: RecursionError: maximum recursion depth exceeded in comparison |
0.224 s | 15 KBi |
#13 |
Correcto
|
0.367 s | 17 KBi |
#14 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 29, in <module> print(suma_num(primera, ultima, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) File "script.py", line 16, in suma_num return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) [Previous line repeated 995 more times] File "script.py", line 15, in suma_num if primera < ultima: RecursionError: maximum recursion depth exceeded in comparison |
0.259 s | 17 KBi |
N = input() linea = input() C = input() consultas = [] for i in range(0,int(C)): con = input() consultas.append( [int(x) for x in con.split()]) arreglo= [int(x) for x in linea.split()] def suma_num(primera, ultima, arreglo): if primera < ultima: return(arreglo[primera] + arreglo[ultima] + suma_num(primera+1, ultima-1, arreglo)) elif primera > ultima: return(0) else: return(arreglo[primera]) for i in consultas: suma = 0 primera = i[0] ultima = i[1] print(suma_num(primera, ultima, arreglo))