結果

問題 No.750 Frac #1
ユーザー kawap23kawap23
提出日時 2019-09-06 20:37:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 26 ms / 1,000 ms
コード長 258 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 10,792 KB
実行使用メモリ 9,948 KB
最終ジャッジ日時 2023-09-06 17:54:17
合計ジャッジ時間 2,376 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
9,856 KB
testcase_01 AC 23 ms
9,828 KB
testcase_02 AC 25 ms
9,856 KB
testcase_03 AC 25 ms
9,604 KB
testcase_04 AC 25 ms
9,716 KB
testcase_05 AC 24 ms
9,644 KB
testcase_06 AC 26 ms
9,724 KB
testcase_07 AC 24 ms
9,720 KB
testcase_08 AC 26 ms
9,860 KB
testcase_09 AC 25 ms
9,824 KB
testcase_10 AC 25 ms
9,568 KB
testcase_11 AC 26 ms
9,912 KB
testcase_12 AC 25 ms
9,792 KB
testcase_13 AC 24 ms
9,948 KB
testcase_14 AC 25 ms
9,744 KB
testcase_15 AC 23 ms
9,712 KB
testcase_16 AC 23 ms
9,752 KB
testcase_17 AC 24 ms
9,824 KB
testcase_18 AC 25 ms
9,856 KB
testcase_19 AC 25 ms
9,888 KB
testcase_20 AC 25 ms
9,664 KB
testcase_21 AC 25 ms
9,724 KB
testcase_22 AC 24 ms
9,676 KB
testcase_23 AC 24 ms
9,568 KB
testcase_24 AC 24 ms
9,832 KB
testcase_25 AC 24 ms
9,672 KB
testcase_26 AC 25 ms
9,624 KB
testcase_27 AC 25 ms
9,724 KB
testcase_28 AC 24 ms
9,744 KB
testcase_29 AC 24 ms
9,568 KB
testcase_30 AC 23 ms
9,852 KB
testcase_31 AC 23 ms
9,680 KB
testcase_32 AC 24 ms
9,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from fractions import Fraction
n = int(input())
AB = [list(map(int, input().split())) for _ in range(n)]

for i in range(n):
    A, B = AB[i]
    AB[i].append(Fraction(A, B))

AB.sort(key = lambda x: x[2], reverse = True)

for i in AB:
    print (i[0], i[1])
0