結果

問題 No.3073 Fraction Median
コンテスト
ユーザー nikoro256
提出日時 2025-03-21 22:47:45
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 208 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,740 ms
コンパイル使用メモリ 95,852 KB
実行使用メモリ 326,552 KB
最終ジャッジ日時 2026-07-07 15:55:16
合計ジャッジ時間 8,583 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 4 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math
N=int(input())
A=list(map(int,input().split()))
l=[1,0]
for i in range(N-1):
    n=(A[i+1],A[i])
    if n[1]*l[0]>=l[1]*n[0]:
        l=n
print(l[1]//math.gcd(l[0],l[1]),l[0]//math.gcd(l[0],l[1]))
0