Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
![]() |
0.006 s | 1 KBi |
#2 |
![]() |
0.006 s | 1 KBi |
#3 |
![]() |
0.004 s | 1 KBi |
#4 |
![]() |
0.004 s | 1 KBi |
#5 |
![]() |
0.004 s | 1 KBi |
#6 |
![]() |
0.004 s | 1 KBi |
#7 |
![]() |
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.006 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.017 s | 2 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.017 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.015 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.021 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.017 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.019 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++) { long long 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; }