結果

問題 No.750 Frac #1
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-12 19:36:21
言語 Java19
(openjdk 21)
結果
AC  
実行時間 170 ms / 1,000 ms
コード長 605 bytes
コンパイル時間 2,202 ms
コンパイル使用メモリ 77,432 KB
実行使用メモリ 58,976 KB
最終ジャッジ日時 2023-10-11 11:00:06
合計ジャッジ時間 9,225 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 163 ms
56,636 KB
testcase_01 AC 161 ms
56,812 KB
testcase_02 AC 161 ms
57,264 KB
testcase_03 AC 163 ms
57,088 KB
testcase_04 AC 166 ms
57,300 KB
testcase_05 AC 167 ms
57,048 KB
testcase_06 AC 163 ms
56,844 KB
testcase_07 AC 161 ms
56,776 KB
testcase_08 AC 165 ms
54,908 KB
testcase_09 AC 164 ms
56,984 KB
testcase_10 AC 167 ms
57,428 KB
testcase_11 AC 170 ms
54,804 KB
testcase_12 AC 165 ms
56,716 KB
testcase_13 AC 165 ms
58,976 KB
testcase_14 AC 164 ms
57,032 KB
testcase_15 AC 165 ms
56,832 KB
testcase_16 AC 166 ms
56,852 KB
testcase_17 AC 165 ms
56,944 KB
testcase_18 AC 168 ms
56,620 KB
testcase_19 AC 164 ms
56,968 KB
testcase_20 AC 165 ms
56,780 KB
testcase_21 AC 164 ms
56,832 KB
testcase_22 AC 164 ms
57,140 KB
testcase_23 AC 166 ms
54,844 KB
testcase_24 AC 164 ms
56,628 KB
testcase_25 AC 165 ms
54,848 KB
testcase_26 AC 165 ms
57,048 KB
testcase_27 AC 165 ms
56,900 KB
testcase_28 AC 164 ms
56,904 KB
testcase_29 AC 165 ms
57,148 KB
testcase_30 AC 165 ms
56,920 KB
testcase_31 AC 163 ms
56,948 KB
testcase_32 AC 164 ms
56,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		int n = sc.nextInt();
		
		Bunsu[] ar = new Bunsu[n];
		for (int i=0; i<n; i++) {
			ar[i] = new Bunsu(sc.nextInt(), sc.nextInt());
		}
		Arrays.sort(ar, Comparator.comparing(Bunsu::getShosu).reversed());
		
		for (int i=0; i<n; i++) {
			System.out.println((int)ar[i].bunsi+" "+(int)ar[i].bunbo);
		}
		
	}
}

class Bunsu {
	double bunsi;
	double bunbo;
	double shosu;
	Bunsu(double a, double b) {
		bunsi = a;
		bunbo = b;
		shosu = a/b;
	}
	double getShosu() {return shosu;}
}
0