結果

問題 No.615 集合に分けよう
ユーザー cielciel
提出日時 2017-12-15 10:53:19
言語 Ruby
(3.2.2)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 88 bytes
コンパイル時間 495 ms
コンパイル使用メモリ 11,388 KB
実行使用メモリ 20,472 KB
最終ジャッジ日時 2023-08-21 06:41:31
合計ジャッジ時間 4,679 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
外部呼び出し有り
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,308 KB
testcase_01 AC 81 ms
15,156 KB
testcase_02 AC 80 ms
15,156 KB
testcase_03 AC 79 ms
15,044 KB
testcase_04 AC 81 ms
15,216 KB
testcase_05 AC 80 ms
15,248 KB
testcase_06 AC 80 ms
15,168 KB
testcase_07 AC 80 ms
15,200 KB
testcase_08 AC 80 ms
15,156 KB
testcase_09 AC 81 ms
15,184 KB
testcase_10 AC 84 ms
15,064 KB
testcase_11 AC 82 ms
15,304 KB
testcase_12 AC 83 ms
15,156 KB
testcase_13 AC 81 ms
15,068 KB
testcase_14 AC 83 ms
15,152 KB
testcase_15 AC 92 ms
15,944 KB
testcase_16 AC 138 ms
20,280 KB
testcase_17 AC 137 ms
20,256 KB
testcase_18 AC 138 ms
20,248 KB
testcase_19 AC 138 ms
20,464 KB
testcase_20 AC 138 ms
20,368 KB
testcase_21 AC 138 ms
20,456 KB
testcase_22 AC 138 ms
20,472 KB
testcase_23 AC 121 ms
19,876 KB
testcase_24 AC 134 ms
20,192 KB
testcase_25 AC 81 ms
15,372 KB
testcase_26 AC 82 ms
15,292 KB
testcase_27 AC 115 ms
19,884 KB
testcase_28 AC 114 ms
19,800 KB
testcase_29 AC 127 ms
20,436 KB
testcase_30 AC 127 ms
20,372 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n,k,*a=`dd`.split.map &:to_i;p a.sort.each_cons(2).map{|x,y|y-x}.sort[0..-k].reduce 0,:+
0