結果

問題 No.35 タイパー高橋
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2015-05-15 10:46:32
言語 Ruby
(3.3.0)
結果
AC  
実行時間 91 ms / 5,000 ms
コード長 361 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 11,236 KB
実行使用メモリ 15,440 KB
最終ジャッジ日時 2023-09-20 08:04:15
合計ジャッジ時間 1,182 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
15,188 KB
testcase_01 AC 89 ms
15,080 KB
testcase_02 AC 91 ms
15,176 KB
testcase_03 AC 86 ms
15,440 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
result = n.times.each_with_object({complete: 0, miss: 0}) {|i,o|
    t, s = gets.split.zip([:to_i, :size]).map {|v, m| v.send(m)}
    
    typeable = 12 * t / 1000
    
    if typeable >= s
        o[:complete] += s
    else
        o[:complete] += typeable
        o[:miss] += (s - typeable)
    end
}
puts "#{result[:complete]} #{result[:miss]}"
0