Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
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 |
#2 |
Error en tiempo de ejecución (NZEC)
Exited with error status 139 run: line 1: 3 Segmentation fault (core dumped) ./a.out |
0.007 s | 1 KBi |
#3 |
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 |
#4 |
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 |
#5 |
Incorrecto
|
0.065 s | 1 KBi |
#6 |
Incorrecto
|
0.089 s | 1 KBi |
#7 |
Incorrecto
|
0.064 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 |
Incorrecto
|
0.066 s | 3 KBi |
#10 |
Incorrecto
|
0.067 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 |
Incorrecto
|
0.102 s | 1 KBi |
#include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<long> S(N); long sum = 0; for (int i = 0; i < N; ++i) { int Ai; cin >> Ai; sum += Ai; S[i] = sum; } int C; cin >> C; int p; int q; for (int i = 0; i < C; ++i) { cin >> p; cin >> q; long total = S[q]; if (p > 0) { total -= S[p - 1]; } cout << total << endl; } }