結果

問題 No.750 Frac #1
ユーザー masamasa
提出日時 2019-01-11 10:28:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 167 ms / 1,000 ms
コード長 674 bytes
コンパイル時間 2,347 ms
コンパイル使用メモリ 80,612 KB
実行使用メモリ 58,992 KB
最終ジャッジ日時 2023-08-18 08:18:38
合計ジャッジ時間 9,923 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 164 ms
56,728 KB
testcase_01 AC 163 ms
56,976 KB
testcase_02 AC 163 ms
57,224 KB
testcase_03 AC 164 ms
57,120 KB
testcase_04 AC 160 ms
56,760 KB
testcase_05 AC 164 ms
57,172 KB
testcase_06 AC 163 ms
57,168 KB
testcase_07 AC 161 ms
57,176 KB
testcase_08 AC 162 ms
57,108 KB
testcase_09 AC 162 ms
57,064 KB
testcase_10 AC 161 ms
57,180 KB
testcase_11 AC 167 ms
56,712 KB
testcase_12 AC 167 ms
56,936 KB
testcase_13 AC 164 ms
57,008 KB
testcase_14 AC 166 ms
57,188 KB
testcase_15 AC 160 ms
57,352 KB
testcase_16 AC 162 ms
57,468 KB
testcase_17 AC 165 ms
57,148 KB
testcase_18 AC 160 ms
56,972 KB
testcase_19 AC 161 ms
57,456 KB
testcase_20 AC 160 ms
57,608 KB
testcase_21 AC 164 ms
56,788 KB
testcase_22 AC 161 ms
58,992 KB
testcase_23 AC 163 ms
57,008 KB
testcase_24 AC 162 ms
56,784 KB
testcase_25 AC 162 ms
57,040 KB
testcase_26 AC 165 ms
57,200 KB
testcase_27 AC 160 ms
57,100 KB
testcase_28 AC 161 ms
57,096 KB
testcase_29 AC 163 ms
57,128 KB
testcase_30 AC 162 ms
57,028 KB
testcase_31 AC 163 ms
56,820 KB
testcase_32 AC 161 ms
57,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc     = new Scanner(System.in);
        int count  = sc.nextInt();
        Map<Float, String> answer = new TreeMap<Float, String>(Comparator.reverseOrder()); 
        
        for (var i = 0; i < count; i++) {
            float bunsi = sc.nextFloat();
            float bunbo = sc.nextFloat();
            
            answer.put(bunsi / bunbo, (int)bunsi + " " + (int)bunbo);
        }
        
        for (Map.Entry<Float, String> set : answer.entrySet()) {
            System.out.println(set.getValue());
        }
    }
}
0