Submission #18664


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
def ascan; gets.split.map(&:to_i); end
def scan; gets.to_i; end
n = scan
data = ascan
m = scan
imos = data.inject([0]){|s,e| s << (s[-1]+e) }
puts imos*" "
m.times{
a,b = ascan
puts imos[b]-imos[a-1]
}

ステータス

項目 データ
問題 0733 - プログラミング入門:累積和
ユーザー名 mai
投稿日時 2017-06-02 21:40:46
言語 Ruby
状態 Accepted
得点 5
ソースコード長 227 Byte
最大実行時間 1915 ms
最大メモリ使用量 133148 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 608 ms 79252 KB
1
Input02 AC 619 ms 88280 KB
1
Input03 AC 742 ms 97472 KB
1
Input04 AC 1915 ms 115352 KB
1
Input05 AC 1909 ms 133148 KB
1