結果
問題 |
No.280 歯車の問題(1)
|
ユーザー |
|
提出日時 | 2016-10-06 15:24:59 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 23 ms / 1,000 ms |
コード長 | 268 bytes |
コンパイル時間 | 138 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 8,064 KB |
最終ジャッジ日時 | 2024-11-21 18:56:17 |
合計ジャッジ時間 | 3,772 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
from fractions import Fraction N = input() Z = map(int, raw_input().split()) theta = [0 for _ in xrange(N)] theta[0] = Fraction(1) for i in xrange(1, N): theta[i] = theta[i-1]*Z[i-1]/Z[i] ans = theta[0]/theta[N-1] print str(ans.numerator)+'/'+str(ans.denominator)