結果

問題 No.750 Frac #1
ユーザー masamasa
提出日時 2019-01-11 10:29:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 169 ms / 1,000 ms
コード長 674 bytes
コンパイル時間 2,832 ms
コンパイル使用メモリ 82,968 KB
実行使用メモリ 59,076 KB
最終ジャッジ日時 2023-08-18 08:21:42
合計ジャッジ時間 9,141 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 164 ms
57,076 KB
testcase_01 AC 163 ms
56,952 KB
testcase_02 AC 160 ms
56,948 KB
testcase_03 AC 162 ms
57,080 KB
testcase_04 AC 168 ms
57,144 KB
testcase_05 AC 164 ms
56,948 KB
testcase_06 AC 162 ms
59,076 KB
testcase_07 AC 164 ms
57,204 KB
testcase_08 AC 169 ms
57,272 KB
testcase_09 AC 161 ms
57,068 KB
testcase_10 AC 163 ms
57,148 KB
testcase_11 AC 163 ms
56,756 KB
testcase_12 AC 162 ms
57,084 KB
testcase_13 AC 159 ms
57,200 KB
testcase_14 AC 159 ms
56,968 KB
testcase_15 AC 165 ms
57,068 KB
testcase_16 AC 162 ms
57,052 KB
testcase_17 AC 159 ms
57,036 KB
testcase_18 AC 158 ms
57,352 KB
testcase_19 AC 158 ms
57,076 KB
testcase_20 AC 158 ms
57,144 KB
testcase_21 AC 166 ms
57,064 KB
testcase_22 AC 158 ms
57,160 KB
testcase_23 AC 163 ms
57,268 KB
testcase_24 AC 162 ms
57,072 KB
testcase_25 AC 160 ms
56,992 KB
testcase_26 AC 164 ms
56,748 KB
testcase_27 AC 159 ms
56,992 KB
testcase_28 AC 167 ms
56,860 KB
testcase_29 AC 160 ms
58,760 KB
testcase_30 AC 160 ms
57,056 KB
testcase_31 AC 162 ms
57,236 KB
testcase_32 AC 162 ms
56,748 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 (int 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