結果
| 問題 | 
                            No.751 Frac #2
                             | 
                    
| コンテスト | |
| ユーザー | 
                             nadare
                         | 
                    
| 提出日時 | 2018-11-09 22:29:12 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 351 bytes | 
| コンパイル時間 | 142 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 11,008 KB | 
| 最終ジャッジ日時 | 2024-11-21 06:20:10 | 
| 合計ジャッジ時間 | 2,408 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 9 WA * 27 | 
ソースコード
# -*- coding: utf-8 -*-
import operator
from functools import reduce
from math import gcd
def inpl(): return list(map(int, input().split()))
n1 = int(input())
A = inpl()
n2 = int(input())
B = inpl()
X = reduce(operator.mul, [A[0]] + B[1:])
Y = reduce(operator.mul, [B[0]] + A[1:])
Z = gcd(X, Y)
if Y < 0:
    X *= -1
    Y *= -1
print(X//Z, Y//Z)
            
            
            
        
            
nadare