結果

問題 No.750 Frac #1
ユーザー kawap23
提出日時 2019-09-06 20:37:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 36 ms / 1,000 ms
コード長 258 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-06-24 12:19:50
合計ジャッジ時間 2,412 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

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