Submission #18671


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import sys
from itertools import accumulate
def solve():
N = int(sys.stdin.readline().rstrip())
Data = [int(i) for i in sys.stdin.readline().split()]
M = int(sys.stdin.readline().rstrip())
Sum = [0] + list(accumulate(Data))
print(*Sum)
for i in range(M):
a, b = map(int, sys.stdin.readline().split())
print(Sum[b] - Sum[a - 1])
if __name__ == '__main__':
solve()

ステータス

項目 データ
問題 0733 - プログラミング入門:累積和
ユーザー名 nanae
投稿日時 2017-06-03 18:24:45
言語 Python3
状態 Accepted
得点 5
ソースコード長 428 Byte
最大実行時間 2691 ms
最大メモリ使用量 131460 KB

セット

セット 得点 Cases
1 ALL 5 / 5 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 772 ms 78480 KB
1
Input02 AC 798 ms 87564 KB
1
Input03 AC 960 ms 97044 KB
1
Input04 AC 2691 ms 114044 KB
1
Input05 AC 2661 ms 131460 KB
1