結果

問題 No.1093 区間の和 / Sum of Range
ユーザー 👑 hos.lyrichos.lyric
提出日時 2020-07-02 03:58:00
言語 Ruby
(3.3.0)
結果
AC  
実行時間 808 ms / 2,000 ms
コード長 189 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 11,336 KB
実行使用メモリ 30,848 KB
最終ジャッジ日時 2023-10-12 15:15:07
合計ジャッジ時間 16,691 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
15,308 KB
testcase_01 AC 420 ms
22,204 KB
testcase_02 AC 224 ms
16,236 KB
testcase_03 AC 152 ms
22,888 KB
testcase_04 AC 142 ms
22,916 KB
testcase_05 AC 572 ms
21,760 KB
testcase_06 AC 169 ms
19,180 KB
testcase_07 AC 349 ms
21,744 KB
testcase_08 AC 311 ms
30,084 KB
testcase_09 AC 489 ms
17,100 KB
testcase_10 AC 329 ms
25,724 KB
testcase_11 AC 520 ms
22,760 KB
testcase_12 AC 329 ms
23,336 KB
testcase_13 AC 82 ms
15,316 KB
testcase_14 AC 571 ms
20,004 KB
testcase_15 AC 186 ms
21,792 KB
testcase_16 AC 643 ms
23,996 KB
testcase_17 AC 531 ms
17,532 KB
testcase_18 AC 379 ms
19,848 KB
testcase_19 AC 103 ms
16,868 KB
testcase_20 AC 312 ms
17,484 KB
testcase_21 AC 599 ms
19,856 KB
testcase_22 AC 614 ms
23,376 KB
testcase_23 AC 442 ms
17,324 KB
testcase_24 AC 166 ms
22,084 KB
testcase_25 AC 526 ms
22,032 KB
testcase_26 AC 430 ms
23,088 KB
testcase_27 AC 600 ms
19,864 KB
testcase_28 AC 418 ms
25,624 KB
testcase_29 AC 808 ms
30,848 KB
testcase_30 AC 158 ms
16,980 KB
testcase_31 AC 187 ms
19,396 KB
testcase_32 AC 250 ms
22,640 KB
testcase_33 AC 646 ms
22,772 KB
testcase_34 AC 111 ms
15,832 KB
testcase_35 AC 620 ms
17,648 KB
testcase_36 AC 563 ms
29,388 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,k=gets.split.map &:to_i
a=gets.split.map &:to_i
s=(0..n).map{0}
n.times{|i|s[i+1]=s[i]+a[i]}
t=(0..n-k).map{|i|s[i+k]-s[i]}.sort+[2e9]
gets.to_i
$<.map{|x|p t.bsearch_index{|y|y>x.to_i}}
0