結果
| 問題 |
No.751 Frac #2
|
| コンテスト | |
| ユーザー |
twkmath
|
| 提出日時 | 2018-11-09 21:58:40 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 1,000 ms |
| コード長 | 334 bytes |
| コンパイル時間 | 153 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,392 KB |
| 最終ジャッジ日時 | 2024-11-21 05:55:10 |
| 合計ジャッジ時間 | 2,658 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 36 |
ソースコード
n=int(input())
a=[int(e) for e in input().split(" ")]
m=int(input())
b=[int(e) for e in input().split(" ")]
mol=a[0]
for i in range(int(m*0.5)):
mol*=b[2*i+1]
den=1
for i in range(int(n)-1):
den*=a[i+1]
for i in range(int((m+1)*0.5)):
den*=b[2*i]
from fractions import Fraction
f=Fraction(mol,den)
print(f.numerator,f.denominator)
twkmath