結果
問題 |
No.751 Frac #2
|
ユーザー |
![]() |
提出日時 | 2019-09-21 19:19:22 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 443 bytes |
コンパイル時間 | 162 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 88,832 KB |
最終ジャッジ日時 | 2024-09-19 03:03:30 |
合計ジャッジ時間 | 6,703 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 2 |
other | RE * 36 |
ソースコード
from fractions import gcd def main(): n = int(input()) a = list(map(int, input().split())) m = int(input()) b = list(map(int, input().split())) ue = a[0] ue2 = 1 for i in range(1, n): ue2 *= a[i] shita = b[0] shita2 = 1 for i in range(1, m): shita2 *= b[i] ue *= shita2 shita *= ue2 g = gcd(ue, shita) print(ue//g, shita//g) if __name__ == '__main__': main()