結果
問題 |
No.751 Frac #2
|
ユーザー |
![]() |
提出日時 | 2018-12-28 00:20:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 324 bytes |
コンパイル時間 | 78 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-10-01 14:56:45 |
合計ジャッジ時間 | 1,928 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 2 |
other | RE * 36 |
ソースコード
n1 =int(input()) list1 =list(map(int,input().split())) n2 =int(input()) list2 =list(map(int,input().split())) nume =list1[0] deno =list2[0] for i in range(n1-1): deno *= list1[i+1] for i in range(n2-1): nume *= list2[i+1] gcd = euclid(nume,deno) if deno < 0: nume *= -1 deno *= -1 print(nume//gcd,deno//gcd)