結果

問題 No.750 Frac #1
ユーザー gemmarogemmaro
提出日時 2019-10-27 09:34:30
言語 Ruby
(3.2.2)
結果
AC  
実行時間 85 ms / 1,000 ms
コード長 215 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 11,268 KB
実行使用メモリ 15,340 KB
最終ジャッジ日時 2023-10-12 22:49:52
合計ジャッジ時間 4,346 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,028 KB
testcase_01 AC 83 ms
15,152 KB
testcase_02 AC 81 ms
15,072 KB
testcase_03 AC 79 ms
15,140 KB
testcase_04 AC 80 ms
15,276 KB
testcase_05 AC 85 ms
15,128 KB
testcase_06 AC 82 ms
15,148 KB
testcase_07 AC 81 ms
15,172 KB
testcase_08 AC 79 ms
15,124 KB
testcase_09 AC 82 ms
15,128 KB
testcase_10 AC 83 ms
15,260 KB
testcase_11 AC 81 ms
15,252 KB
testcase_12 AC 80 ms
15,032 KB
testcase_13 AC 79 ms
15,016 KB
testcase_14 AC 80 ms
15,120 KB
testcase_15 AC 79 ms
15,240 KB
testcase_16 AC 79 ms
15,156 KB
testcase_17 AC 80 ms
15,112 KB
testcase_18 AC 83 ms
15,340 KB
testcase_19 AC 80 ms
15,260 KB
testcase_20 AC 80 ms
15,268 KB
testcase_21 AC 80 ms
15,292 KB
testcase_22 AC 79 ms
15,340 KB
testcase_23 AC 79 ms
15,164 KB
testcase_24 AC 79 ms
15,116 KB
testcase_25 AC 80 ms
15,080 KB
testcase_26 AC 79 ms
15,064 KB
testcase_27 AC 79 ms
15,256 KB
testcase_28 AC 79 ms
15,148 KB
testcase_29 AC 81 ms
15,112 KB
testcase_30 AC 80 ms
15,144 KB
testcase_31 AC 81 ms
15,256 KB
testcase_32 AC 80 ms
15,060 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.chomp.to_i

fracs = []
n.times {
    a, b = gets.chomp.split.map &:to_i
    fracs << [a, b]
}

fracs.sort! {|a, b|
     b[0].to_f / b[1] <=> a[0].to_f / a[1]
}

fracs.each {|a, b|
    puts [a, b].join ' '
}
0