結果

問題 No.751 Frac #2
ユーザー 👑 H20H20
提出日時 2020-12-23 11:12:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 509 bytes
コンパイル時間 462 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 53,736 KB
最終ジャッジ日時 2023-10-21 15:06:18
合計ジャッジ時間 3,023 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,716 KB
testcase_01 AC 38 ms
53,716 KB
testcase_02 WA -
testcase_03 AC 37 ms
53,716 KB
testcase_04 AC 39 ms
53,716 KB
testcase_05 AC 36 ms
53,716 KB
testcase_06 AC 37 ms
53,716 KB
testcase_07 WA -
testcase_08 AC 37 ms
53,716 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 37 ms
53,716 KB
testcase_13 AC 37 ms
53,716 KB
testcase_14 AC 37 ms
53,716 KB
testcase_15 AC 36 ms
53,716 KB
testcase_16 WA -
testcase_17 AC 37 ms
53,716 KB
testcase_18 AC 37 ms
53,716 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 37 ms
53,716 KB
testcase_22 WA -
testcase_23 AC 38 ms
53,716 KB
testcase_24 AC 36 ms
53,716 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 37 ms
53,716 KB
testcase_28 AC 37 ms
53,716 KB
testcase_29 AC 37 ms
53,716 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 37 ms
53,716 KB
testcase_33 AC 38 ms
53,716 KB
testcase_34 AC 39 ms
53,716 KB
testcase_35 WA -
testcase_36 AC 38 ms
53,716 KB
testcase_37 AC 38 ms
53,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

alen = int(input())
A = list(map(int,input().split()))
blen = int(input())
B = list(map(int,input().split()))

C = []
P = []
sig = 1
for i in range(alen):
    if i==0:
        C.append(A[i])
    else:
        P.append(A[i])
    sig*=A[i]
for i in range(blen):
    if (i+blen)%2==1:
        C.append(B[i])
    else:
        P.append(B[i])
    sig*=B[i]
sig = sig//abs(sig)
c = 1
p = 1
for i in C:
    c *= i
for i in P:
    p *= i
gcd = math.gcd(abs(c),abs(p))
print(sig*abs(c)//gcd,abs(p)//gcd)

0