結果
| 問題 |
No.3073 Fraction Median
|
| コンテスト | |
| ユーザー |
遭難者
|
| 提出日時 | 2025-03-12 00:56:26 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,308 ms / 2,500 ms |
| コード長 | 218 bytes |
| コンパイル時間 | 534 ms |
| コンパイル使用メモリ | 82,728 KB |
| 実行使用メモリ | 290,004 KB |
| 最終ジャッジ日時 | 2025-03-20 02:01:55 |
| 合計ジャッジ時間 | 20,086 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
from fractions import Fraction
n = int(input())
a = sorted(list(map(int, input().split())))
ans = Fraction(0, 1)
for i in range(1, n):
ans = max(ans, Fraction(a[i - 1], a[i]))
print(ans.numerator, ans.denominator)
遭難者