結果
| 問題 | No.750 Frac #1 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-02 23:50:57 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 1,000 ms |
| コード長 | 269 bytes |
| 記録 | |
| コンパイル時間 | 275 ms |
| コンパイル使用メモリ | 85,504 KB |
| 実行使用メモリ | 54,656 KB |
| 最終ジャッジ日時 | 2026-05-15 15:08:58 |
| 合計ジャッジ時間 | 2,486 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
from functools import cmp_to_key
def cmp(a, b):
if a[0]*b[1]==a[1]*b[0]:
return 0
return -1 if a[0]*b[1]>a[1]*b[0] else 1
n = int(input())
AB = [list(map(int, input().split())) for _ in range(n)]
AB.sort(key=cmp_to_key(cmp))
for ab in AB:
print(*ab)