結果
| 問題 | 
                            No.750 Frac #1
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2019-05-23 21:54:53 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 36 ms / 1,000 ms | 
| コード長 | 249 bytes | 
| コンパイル時間 | 110 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 11,520 KB | 
| 最終ジャッジ日時 | 2024-09-17 09:51:59 | 
| 合計ジャッジ時間 | 2,401 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge6 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 30 | 
ソースコード
from fractions import Fraction
n = int(input())
l = list()
for i in range(1,n+1):
    a,b = map(int,input().split())
    l.append((a,b))
l = sorted(l,key=lambda x:Fraction(x[0],x[1]), reverse=True)
for x in l:
    print(str(x[0]) +" " + str(x[1]))