Submit Info #67304

Problem Lang User Status Time Memory
Static Range Sum python3 (anonymous) AC 1188 ms 178.48 MiB

ケース詳細
Name Status Time Memory
example_00 AC 15 ms 3.52 MiB
max_random_00 AC 1146 ms 178.48 MiB
max_random_01 AC 1140 ms 178.40 MiB
max_random_02 AC 1142 ms 178.41 MiB
max_random_03 AC 1188 ms 178.48 MiB
max_random_04 AC 1142 ms 178.48 MiB
random_00 AC 895 ms 148.02 MiB
random_01 AC 935 ms 155.41 MiB
random_02 AC 656 ms 103.93 MiB
random_03 AC 225 ms 56.92 MiB
random_04 AC 279 ms 57.62 MiB

import sys lines = [line.strip() for line in sys.stdin] info = [int(x) for x in lines[0].split()] a = [int(x) for x in lines[1].split()] queries = [[int(x) for x in line.split()] for line in lines[2:]] front = a.copy() for i in range(1, len(a)): front[i] = front[i-1] + a[i] for query in queries: early = front[query[0]-1] if query[0] != 0 else 0 print(front[query[1]-1]-early)