結果
| 問題 |
No.3073 Fraction Median
|
| コンテスト | |
| ユーザー |
あじゃじゃ
|
| 提出日時 | 2025-03-21 21:49:05 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 386 bytes |
| コンパイル時間 | 271 ms |
| コンパイル使用メモリ | 82,560 KB |
| 実行使用メモリ | 355,420 KB |
| 最終ジャッジ日時 | 2025-03-21 21:49:15 |
| 合計ジャッジ時間 | 9,214 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 TLE * 1 -- * 11 |
ソースコード
n=int(input())
a=list(map(int,input().split()))
a.sort()
b=[]
for i in range(n-1):
b.append((a[i],a[i+1]))
from functools import cmp_to_key
def c(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
b.sort(key=cmp_to_key(c))
from math import gcd
g=gcd(b[-1][0],b[-1][1])
print(b[-1][0]//g,b[-1][1]//g)
あじゃじゃ