結果
| 問題 | No.751 Frac #2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-11-09 23:29:06 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 101 ms / 1,000 ms |
| + 271µs | |
| コード長 | 382 bytes |
| 記録 | |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 81,068 KB |
| 実行使用メモリ | 95,144 KB |
| 最終ジャッジ日時 | 2026-07-18 18:37:19 |
| 合計ジャッジ時間 | 5,780 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 36 |
ソースコード
#!/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