結果

問題 No.751 Frac #2
ユーザー pluto77
提出日時 2018-11-11 11:04:51
言語 Python2
(2.7.18)
結果
AC  
実行時間 24 ms / 1,000 ms
コード長 294 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 8,188 KB
最終ジャッジ日時 2024-11-29 01:54:10
合計ジャッジ時間 2,712 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki751

from operator import mul
from fractions import Fraction as f

n1=int(raw_input())
a=map(int,raw_input().split())
n2=int(raw_input())
b=map(int,raw_input().split())
nu=[a[0]]+b[1::2]
de=a[1:]+b[0::2]
nu=reduce(mul,nu)
de=reduce(mul,de)
res=f(nu,de)
print res.numerator,res.denominator
0