結果
| 問題 | No.750 Frac #1 |
| コンテスト | |
| ユーザー |
toyuzuko
|
| 提出日時 | 2020-06-01 19:02:30 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 96 ms / 1,000 ms |
| コード長 | 326 bytes |
| 記録 | |
| コンパイル時間 | 352 ms |
| コンパイル使用メモリ | 20,948 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-05-16 08:31:50 |
| 合計ジャッジ時間 | 4,821 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
from functools import cmp_to_key
def cmp(x, y):
x0, x1 = x
y0, y1 = y
if x0 * y1 > x1 * y0:
return -1
elif x0 * y1 < x1 * y0:
return 1
else:
return 0
N = int(input())
F = [tuple(map(int, input().split())) for _ in range(N)]
F.sort(key=cmp_to_key(cmp))
for f in F:
print(*f)
toyuzuko