結果
| 問題 | 
                            No.751 Frac #2
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-11-09 22:26:45 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 403 bytes | 
| コンパイル時間 | 290 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 11,392 KB | 
| 最終ジャッジ日時 | 2024-11-21 06:18:24 | 
| 合計ジャッジ時間 | 2,531 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 4 WA * 32 | 
ソースコード
from fractions import Fraction as fra
na=int(input())
la=list(map(int,input().split()))
nb=int(input())
lb=list(map(int,input().split()))
if na == 1:
    a=fra(1,1)
else:
    a=fra(la[0],la[1])
    for i in range(2,na):
        a=a*fra(1,la[i])
if nb == 1:
    b=fra(1,1)
else:
    b=fra(lb[0],lb[1])
    for i in range(2,nb):
        b=b*fra(1,lb[i])
ans=a/b
print(ans.numerator, ans.denominator)