Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.006 s | 1 KBi |
#2 |
Correcto
|
0.006 s | 8 KBi |
#3 |
Correcto
|
0.006 s | 2 KBi |
#4 |
Correcto
|
0.006 s | 2 KBi |
#5 |
Correcto
|
0.005 s | 1 KBi |
#6 |
Correcto
|
0.005 s | 2 KBi |
#7 |
Correcto
|
0.006 s | 1 KBi |
#8 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.005 s | 4 KBi |
#9 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.006 s | 3 KBi |
#10 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.006 s | 1 KBi |
#11 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.006 s | 1 KBi |
#12 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.005 s | 1 KBi |
#13 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.006 s | 1 KBi |
#14 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.006 s | 1 KBi |
#include <iostream> using namespace std; int main() { int N; cin >> N; int A[N]; int totals[N][N]; long sum = 0; for (int i = 0; i<N; ++i) { int Ai; cin >> Ai; sum += Ai; A[i] = Ai; totals[0][i] = sum; } for (int i=1; i < N; ++i) { for (int j=0; j < N; ++j) { totals[i][j] = totals[i-1][j] - A[i-1]; } } int C; cin >> C; int p; int q; for (int i =0; i < C; ++i) { cin >> p; cin >> q; cout << totals[p][q] << endl; } }