Submit Info #66208

Problem Lang User Status Time Memory
Static Range Sum cpp (anonymous) AC 182 ms 11.51 MiB

ケース詳細
Name Status Time Memory
example_00 AC 1 ms 0.41 MiB
max_random_00 AC 180 ms 11.45 MiB
max_random_01 AC 182 ms 11.51 MiB
max_random_02 AC 180 ms 11.50 MiB
max_random_03 AC 180 ms 11.45 MiB
max_random_04 AC 179 ms 11.50 MiB
random_00 AC 141 ms 9.29 MiB
random_01 AC 152 ms 9.85 MiB
random_02 AC 81 ms 5.97 MiB
random_03 AC 43 ms 3.94 MiB
random_04 AC 49 ms 3.93 MiB

#include <cstdio> #include <vector> using ll = long long int; int main() { int N, Q; scanf("%d%d", &N, &Q); std::vector<ll> A(N+1); for(int i=0; i<N; i++) scanf("%lld", &A[i+1]), A[i+1] += A[i]; while(Q--) { int l, r; scanf("%d%d", &l, &r); printf("%lld\n", A[r] - A[l]); } return 0; }