結果

問題 No.751 Frac #2
ユーザー convexineqconvexineq
提出日時 2021-03-14 17:25:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 286 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 82,492 KB
実行使用メモリ 54,200 KB
最終ジャッジ日時 2024-04-24 00:30:33
合計ジャッジ時間 3,061 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
m = int(input())
*b, = map(int,input().split())

p = a[0]
q = 1
for i in a[1:]:
    q *= i
for i in b[m-1::-2]:
    p *= i
for i in b[m-2::-2]:
    q *= i
from math import gcd
g = gcd(p,q)
p //= g; q //= g
if q < 0: p,q = -p,-q
print(p,q)
0