Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.005 s | 1 KBi |
#2 |
Correcto
|
0.006 s | 1 KBi |
#3 |
Correcto
|
0.004 s | 1 KBi |
#4 |
Correcto
|
0.005 s | 1 KBi |
#5 |
Correcto
|
0.005 s | 1 KBi |
#6 |
Correcto
|
0.005 s | 1 KBi |
#7 |
Correcto
|
0.004 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.009 s | 1 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.022 s | 1 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.016 s | 2 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.016 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.024 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.02 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.013 s | 1 KBi |
#include <iostream> #include <climits> using namespace std; int main() { int n; cin>>n; int arr[n]; for(int i = 0; i < n; i++) { cin>>arr[i]; } long long int sums[n][n]; for(int i = 0; i < n; i++) { int currSum = 0; for(int j = i; j < n; j++) { currSum += arr[j]; sums[i][j] = currSum; } } int c; cin>>c; long long int results[c]; for(int i = 0; i < c; i++) { int p, q; cin>>p>>q; results[i] = sums[p][q]; } for(int i = 0; i < c; i++) { cout<<results[i]<<endl; } return 0; }