Submit Info #68461

Problem Lang User Status Time Memory
Static Range Sum cpp14 (anonymous) AC 147 ms 11.53 MiB

ケース詳細
Name Status Time Memory
example_00 AC 1 ms 0.45 MiB
max_random_00 AC 146 ms 11.53 MiB
max_random_01 AC 145 ms 11.53 MiB
max_random_02 AC 147 ms 11.48 MiB
max_random_03 AC 147 ms 11.53 MiB
max_random_04 AC 146 ms 11.49 MiB
random_00 AC 118 ms 9.30 MiB
random_01 AC 125 ms 9.87 MiB
random_02 AC 77 ms 5.93 MiB
random_03 AC 41 ms 4.04 MiB
random_04 AC 44 ms 3.94 MiB

#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); cin.tie(0); ll n, q; cin >> n >> q; ll a[n+1]; a[0] = 0; for (int i = 0; i < n; i++) { cin >> a[i+1]; a[i+1] += a[i]; } for (int i = 0; i < q; i++) { ll l, r; cin >> l >> r; cout << a[r] - a[l] << '\n'; } }