結果

問題 No.751 Frac #2
ユーザー yuppe19 😺yuppe19 😺
提出日時 2018-11-09 23:29:06
言語 Python2
(2.7.18)
結果
AC  
実行時間 23 ms / 1,000 ms
コード長 382 bytes
コンパイル時間 1,263 ms
コンパイル使用メモリ 6,588 KB
実行使用メモリ 7,796 KB
最終ジャッジ日時 2023-08-13 12:11:06
合計ジャッジ時間 4,094 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
7,748 KB
testcase_01 AC 22 ms
7,576 KB
testcase_02 AC 22 ms
7,748 KB
testcase_03 AC 22 ms
7,716 KB
testcase_04 AC 23 ms
7,612 KB
testcase_05 AC 22 ms
7,668 KB
testcase_06 AC 21 ms
7,688 KB
testcase_07 AC 22 ms
7,668 KB
testcase_08 AC 22 ms
7,580 KB
testcase_09 AC 20 ms
7,780 KB
testcase_10 AC 21 ms
7,572 KB
testcase_11 AC 22 ms
7,600 KB
testcase_12 AC 22 ms
7,568 KB
testcase_13 AC 22 ms
7,796 KB
testcase_14 AC 22 ms
7,688 KB
testcase_15 AC 21 ms
7,580 KB
testcase_16 AC 22 ms
7,600 KB
testcase_17 AC 22 ms
7,604 KB
testcase_18 AC 22 ms
7,668 KB
testcase_19 AC 21 ms
7,576 KB
testcase_20 AC 22 ms
7,564 KB
testcase_21 AC 22 ms
7,692 KB
testcase_22 AC 21 ms
7,564 KB
testcase_23 AC 22 ms
7,612 KB
testcase_24 AC 23 ms
7,584 KB
testcase_25 AC 22 ms
7,720 KB
testcase_26 AC 22 ms
7,744 KB
testcase_27 AC 22 ms
7,564 KB
testcase_28 AC 21 ms
7,604 KB
testcase_29 AC 22 ms
7,580 KB
testcase_30 AC 22 ms
7,604 KB
testcase_31 AC 22 ms
7,564 KB
testcase_32 AC 22 ms
7,568 KB
testcase_33 AC 21 ms
7,604 KB
testcase_34 AC 22 ms
7,664 KB
testcase_35 AC 22 ms
7,752 KB
testcase_36 AC 22 ms
7,780 KB
testcase_37 AC 21 ms
7,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python2
# -*- coding: utf-8 -*-
# †
from operator import mul
from fractions import Fraction as frac

n = int(raw_input())
a = map(int, raw_input().split())
m = int(raw_input())
b = map(int, raw_input().split())
nume = [a[0]] + b[1::2]
deno = a[1:]  + b[0::2]
nume = reduce(mul, nume)
deno = reduce(mul, deno)
res = frac(nume, deno)
print res.numerator, res.denominator
0