Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.004 s | 1 KBi |
#2 |
Correcto
|
0.004 s | 2 KBi |
#3 |
Correcto
|
0.003 s | 1 KBi |
#4 |
Correcto
|
0.004 s | 1 KBi |
#5 |
Correcto
|
0.005 s | 1 KBi |
#6 |
Correcto
|
0.005 s | 1 KBi |
#7 |
Correcto
|
0.005 s | 1 KBi |
#8 |
Correcto
|
0.008 s | 1 KBi |
#9 |
Correcto
|
0.026 s | 2 KBi |
#10 |
Correcto
|
0.023 s | 2 KBi |
#11 |
Correcto
|
0.038 s | 2 KBi |
#12 |
Correcto
|
0.026 s | 2 KBi |
#13 |
Correcto
|
0.028 s | 1 KBi |
#14 |
Correcto
|
0.029 s | 2 KBi |
#include<stdio.h> #define ll long long int main(){ int n; scanf(" %d",&n); ll nums[n]; for(int i = 0; i < n;++i){ scanf(" %lld",&nums[i]); if(i) nums[i] += nums[i-1]; } int q; scanf(" %d",&q); while(q--){ int l,r; scanf(" %d %d",&l,&r); --l; printf("%lld\n",nums[r]-(l > -1 ? nums[l]:0)); } return 0; }