Submit Info #65296

Problem Lang User Status Time Memory
Static Range Sum pypy3 (anonymous) AC 1308 ms 136.88 MiB

ケース詳細
Name Status Time Memory
example_00 AC 50 ms 29.54 MiB
max_random_00 AC 1308 ms 136.78 MiB
max_random_01 AC 1305 ms 136.84 MiB
max_random_02 AC 1272 ms 136.84 MiB
max_random_03 AC 1293 ms 136.81 MiB
max_random_04 AC 1284 ms 136.88 MiB
random_00 AC 1052 ms 128.12 MiB
random_01 AC 1104 ms 131.62 MiB
random_02 AC 909 ms 43.88 MiB
random_03 AC 241 ms 112.57 MiB
random_04 AC 380 ms 88.98 MiB

n,q=map(int,input().split()) a=list(map(int,input().split())) pre=[];su=0 for i in range(n): su+=a[i] pre.append(su) for i in range(q): l,r=map(int,input().split()) if l==0: j=0 else: j=pre[l-1] print(pre[r-1]-j)