結果

問題 No.750 Frac #1
ユーザー kazukikazuki
提出日時 2018-11-17 01:38:04
言語 Ruby
(3.2.2)
結果
AC  
実行時間 70 ms / 1,000 ms
コード長 255 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 11,420 KB
実行使用メモリ 15,340 KB
最終ジャッジ日時 2023-08-26 01:38:26
合計ジャッジ時間 4,606 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
15,320 KB
testcase_01 AC 66 ms
15,152 KB
testcase_02 AC 69 ms
15,156 KB
testcase_03 AC 66 ms
15,328 KB
testcase_04 AC 67 ms
15,112 KB
testcase_05 AC 67 ms
15,136 KB
testcase_06 AC 68 ms
15,164 KB
testcase_07 AC 68 ms
15,128 KB
testcase_08 AC 68 ms
15,104 KB
testcase_09 AC 67 ms
15,268 KB
testcase_10 AC 67 ms
15,160 KB
testcase_11 AC 67 ms
15,104 KB
testcase_12 AC 67 ms
15,304 KB
testcase_13 AC 67 ms
15,132 KB
testcase_14 AC 69 ms
15,032 KB
testcase_15 AC 68 ms
15,164 KB
testcase_16 AC 69 ms
15,340 KB
testcase_17 AC 68 ms
15,088 KB
testcase_18 AC 67 ms
15,152 KB
testcase_19 AC 66 ms
15,264 KB
testcase_20 AC 67 ms
15,164 KB
testcase_21 AC 66 ms
15,264 KB
testcase_22 AC 68 ms
15,028 KB
testcase_23 AC 69 ms
15,108 KB
testcase_24 AC 68 ms
15,220 KB
testcase_25 AC 70 ms
15,324 KB
testcase_26 AC 68 ms
15,304 KB
testcase_27 AC 66 ms
15,160 KB
testcase_28 AC 67 ms
15,208 KB
testcase_29 AC 67 ms
15,328 KB
testcase_30 AC 66 ms
15,168 KB
testcase_31 AC 67 ms
15,036 KB
testcase_32 AC 68 ms
15,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i

a = Array.new(n)
b = Array.new(n)
c = Array.new(n)

n.times do |i|
  a[i], b[i] = gets.split.map{|x| x.to_i}
  c[i] = i
end

b_times = b.inject(:*)

c.sort_by!{|i| a[i] * b_times / b[i]}.reverse!

c.each do |i|
  puts "#{a[i]} #{b[i]}"
end
0