Submit Info #67766

Problem Lang User Status Time Memory
Static Range Sum python3 liuant AC 767 ms 58.67 MiB

ケース詳細
Name Status Time Memory
example_00 AC 15 ms 3.47 MiB
max_random_00 AC 750 ms 58.66 MiB
max_random_01 AC 767 ms 58.67 MiB
max_random_02 AC 752 ms 58.55 MiB
max_random_03 AC 759 ms 58.62 MiB
max_random_04 AC 757 ms 58.62 MiB
random_00 AC 644 ms 49.40 MiB
random_01 AC 650 ms 58.01 MiB
random_02 AC 417 ms 12.14 MiB
random_03 AC 182 ms 54.03 MiB
random_04 AC 212 ms 36.14 MiB

import sys n, q = map(int, sys.stdin.readline().split()) a = list(map(int, sys.stdin.readline().split())) for i in range(1, len(a)): a[i] += a[i-1] for _ in range(q): l, r = map(int, sys.stdin.readline().split()) print(a[r-1] - (a[l-1] if l > 0 else 0))