結果

問題 No.394 ハーフパイプ(1)
ユーザー mesh1nek0x0mesh1nek0x0
提出日時 2018-07-23 21:25:49
言語 Ruby
(3.3.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 190 bytes
コンパイル時間 58 ms
コンパイル使用メモリ 11,516 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2023-08-28 23:41:55
合計ジャッジ時間 1,844 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
15,028 KB
testcase_01 AC 84 ms
15,224 KB
testcase_02 AC 80 ms
15,240 KB
testcase_03 AC 80 ms
15,148 KB
testcase_04 AC 80 ms
15,312 KB
testcase_05 AC 78 ms
15,132 KB
testcase_06 AC 79 ms
15,132 KB
testcase_07 AC 80 ms
15,360 KB
testcase_08 AC 79 ms
15,200 KB
testcase_09 AC 81 ms
15,024 KB
testcase_10 AC 79 ms
15,132 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/bin/ruby
s = gets.chomp.split(' ')

s.sort! { | a, b| a.to_i <=> b.to_i }

s.delete_at(0)
s.delete_at(s.length - 1)

puts "%.2f" % (s.inject(0.0) { |tmp, num| tmp += num.to_f } / s.size)
0