結果
| 問題 | No.3073 Fraction Median |
| コンテスト | |
| ユーザー |
PNJ
|
| 提出日時 | 2025-03-22 15:13:00 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 378 bytes |
| 記録 | |
| コンパイル時間 | 233 ms |
| コンパイル使用メモリ | 96,104 KB |
| 実行使用メモリ | 417,240 KB |
| 最終ジャッジ日時 | 2026-07-07 20:08:32 |
| 合計ジャッジ時間 | 8,903 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 TLE * 1 -- * 11 |
ソースコード
from functools import cmp_to_key def cmp(a, b): x, y = a xx, yy = b s = x * yy - y * xx return 1 if s > 0 else -1 if s < 0 else 0 def gcd(a, b): while b: a, b = b, a % b return a N = int(input()) A = list(map(int, input().split())) A.sort() B = [(A[i - 1], A[i]) for i in range(1, N)] B.sort(key = cmp_to_key(cmp)) a, b = B[-1] g = gcd(a, b) print(a // g, b // g)
PNJ