結果

問題 No.798 コレクション
ユーザー %20%20
提出日時 2020-08-28 00:19:15
言語 Ruby
(3.3.0)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 122 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 11,564 KB
実行使用メモリ 15,364 KB
最終ジャッジ日時 2023-08-08 17:33:17
合計ジャッジ時間 4,419 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,288 KB
testcase_01 AC 77 ms
15,276 KB
testcase_02 AC 77 ms
15,240 KB
testcase_03 AC 77 ms
15,356 KB
testcase_04 AC 77 ms
15,256 KB
testcase_05 AC 78 ms
15,056 KB
testcase_06 AC 80 ms
15,288 KB
testcase_07 AC 76 ms
15,296 KB
testcase_08 AC 76 ms
15,188 KB
testcase_09 AC 77 ms
15,140 KB
testcase_10 AC 76 ms
15,236 KB
testcase_11 AC 77 ms
15,192 KB
testcase_12 AC 77 ms
15,156 KB
testcase_13 AC 150 ms
15,364 KB
testcase_14 AC 195 ms
15,156 KB
testcase_15 AC 178 ms
15,344 KB
testcase_16 AC 124 ms
15,144 KB
testcase_17 AC 153 ms
15,140 KB
testcase_18 AC 230 ms
15,064 KB
testcase_19 AC 201 ms
15,272 KB
testcase_20 AC 126 ms
15,120 KB
testcase_21 AC 120 ms
15,140 KB
testcase_22 AC 179 ms
15,136 KB
testcase_23 AC 78 ms
15,200 KB
testcase_24 AC 242 ms
15,304 KB
testcase_25 AC 242 ms
15,096 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets
*d=j=0
$<.map{_1.split.map &:to_i}.sort_by{-_2}.map{i=j+=1
d[i]=[d[i]||1e12,d[i-=1]+_1+_2*i].min while i>0}
p d[~j/3]
0