結果
| 問題 | No.751 Frac #2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-11 18:54:01 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 26 ms / 1,000 ms |
| + 127µs | |
| コード長 | 403 bytes |
| 記録 | |
| コンパイル時間 | 62 ms |
| コンパイル使用メモリ | 14,848 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2026-10-13 22:27:42 |
| 合計ジャッジ時間 | 3,113 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 37 |
ソースコード
#!/usr/bin/env python3
# †
from fractions import Fraction as frac
from functools import reduce
###
if __name__ == '__main__':
input()
a = list(map(int, input().split()))
input()
b = list(map(int, input().split()))
nume = reduce(lambda x, y: frac(x, y), a)
deno = reduce(lambda x, y: frac(y, x), reversed(b))
res = frac(nume, deno)
print(res.numerator, res.denominator)