結果

問題 No.751 Frac #2
ユーザー nebukuro09
提出日時 2018-11-09 21:26:06
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 284 bytes
コンパイル時間 46 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 8,192 KB
最終ジャッジ日時 2024-11-21 05:32:31
合計ジャッジ時間 1,861 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

from fractions import Fraction as F
N = input()
A = map(int, raw_input().split())
M = input()
B = map(int, raw_input().split())
B.reverse()
X = A[0]
for i in xrange(1, N):
    X /= F(A[i])
Y = B[0]
for i in xrange(1, M):
    Y = F(B[i]) / Y
Z = X / Y
print Z.numerator, Z.denominator
0