結果

問題 No.53 悪の漸化式
ユーザー beetbeet
提出日時 2018-11-15 15:00:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 27 ms / 5,000 ms
コード長 204 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 9,904 KB
最終ジャッジ日時 2023-08-26 01:16:36
合計ジャッジ時間 1,506 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
9,796 KB
testcase_01 AC 24 ms
9,652 KB
testcase_02 AC 24 ms
9,708 KB
testcase_03 AC 24 ms
9,660 KB
testcase_04 AC 24 ms
9,740 KB
testcase_05 AC 23 ms
9,696 KB
testcase_06 AC 23 ms
9,784 KB
testcase_07 AC 25 ms
9,692 KB
testcase_08 AC 24 ms
9,784 KB
testcase_09 AC 24 ms
9,740 KB
testcase_10 AC 24 ms
9,768 KB
testcase_11 AC 23 ms
9,652 KB
testcase_12 AC 24 ms
9,548 KB
testcase_13 AC 24 ms
9,904 KB
testcase_14 AC 24 ms
9,656 KB
testcase_15 AC 24 ms
9,660 KB
testcase_16 AC 24 ms
9,668 KB
testcase_17 AC 25 ms
9,576 KB
testcase_18 AC 24 ms
9,576 KB
testcase_19 AC 24 ms
9,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from fractions import Fraction
n = int(input())
a = [Fraction(4, 1), Fraction(3, 1)]
for i in range(0, n):
    a.append((-12*a[i]+19*a[i+1])/4)

print('{:.15f}'.format(a[n].numerator / a[n].denominator))
0