| 10 | |
| 11 | using namespace std; |
| 12 | int main(){ |
| 13 | read(n); |
| 14 | for (int i = 1; i <=n; ++i) |
| 15 | { |
| 16 | cin>>arr[i]; |
| 17 | } |
| 18 | read(t); |
| 19 | while(t--){ |
| 20 | read(l);read(r); |
| 21 | ll sum=0; |
| 22 | for (int i = l; i <= r; ++i) |
| 23 | { |
| 24 | sum+=arr[i]; |
| 25 | } |
| 26 | cout<<sum<<endl; |
| 27 | } |
| 28 | |
| 29 | return 0; |
| 30 | } |
nothing calls this directly
no outgoing calls
no test coverage detected