Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.005 s | 1 KBi |
#2 |
Correcto
|
0.006 s | 1 KBi |
#3 |
Correcto
|
0.005 s | 1 KBi |
#4 |
Correcto
|
0.005 s | 1 KBi |
#5 |
Correcto
|
0.005 s | 1 KBi |
#6 |
Correcto
|
0.006 s | 64 KBi |
#7 |
Correcto
|
0.006 s | 1 KBi |
#8 |
Correcto
|
0.022 s | 2 KBi |
#9 |
Correcto
|
0.033 s | 1 KBi |
#10 |
Correcto
|
0.032 s | 1 KBi |
#11 |
Correcto
|
0.037 s | 2 KBi |
#12 |
Correcto
|
0.04 s | 1 KBi |
#13 |
Correcto
|
0.036 s | 1 KBi |
#14 |
Correcto
|
0.032 s | 1 KBi |
#include <iostream> #include <map> using namespace std; int main() { int len, c, q, p; cin >> len; int output[len]; int current; cin >> output[0]; for(int i=1;i<len; i++){ int current; cin >> current; output[i] = current + output[i-1]; } cin >> c; for(int i=0; i<c;i++){ cin >> q; cin >> p; if(q == 0){ cout << output[p] << endl; } else{ cout << output[p] - output[q-1] << endl; } } }