結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
15,116 KB
testcase_01 AC 413 ms
22,148 KB
testcase_02 AC 216 ms
16,412 KB
testcase_03 AC 150 ms
22,888 KB
testcase_04 AC 142 ms
23,168 KB
testcase_05 AC 566 ms
21,992 KB
testcase_06 AC 173 ms
19,188 KB
testcase_07 AC 345 ms
21,784 KB
testcase_08 AC 313 ms
30,072 KB
testcase_09 AC 491 ms
17,200 KB
testcase_10 AC 322 ms
25,720 KB
testcase_11 AC 512 ms
22,692 KB
testcase_12 AC 330 ms
23,288 KB
testcase_13 AC 82 ms
15,364 KB
testcase_14 AC 548 ms
19,856 KB
testcase_15 AC 188 ms
21,656 KB
testcase_16 AC 625 ms
23,808 KB
testcase_17 AC 529 ms
17,172 KB
testcase_18 AC 375 ms
19,932 KB
testcase_19 AC 103 ms
17,040 KB
testcase_20 AC 318 ms
17,276 KB
testcase_21 AC 616 ms
19,764 KB
testcase_22 AC 606 ms
23,260 KB
testcase_23 AC 447 ms
17,152 KB
testcase_24 AC 167 ms
22,112 KB
testcase_25 AC 520 ms
22,224 KB
testcase_26 AC 415 ms
23,172 KB
testcase_27 AC 574 ms
19,892 KB
testcase_28 AC 401 ms
25,580 KB
testcase_29 AC 791 ms
31,064 KB
testcase_30 AC 152 ms
17,032 KB
testcase_31 AC 181 ms
19,256 KB
testcase_32 AC 240 ms
22,680 KB
testcase_33 AC 621 ms
22,588 KB
testcase_34 AC 109 ms
15,928 KB
testcase_35 AC 615 ms
17,480 KB
testcase_36 AC 533 ms
29,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:6: warning: assigned but unused variable - q
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]
q=gets.to_i
$<.map{|x|p t.bsearch_index{|y|y>x.to_i}}
0