結果

問題 No.53 悪の漸化式
ユーザー yozayoza
提出日時 2014-10-30 23:43:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 206 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 7,992 KB
最終ジャッジ日時 2023-08-28 23:31:41
合計ジャッジ時間 1,210 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,912 KB
testcase_01 WA -
testcase_02 AC 14 ms
7,912 KB
testcase_03 AC 12 ms
7,916 KB
testcase_04 AC 14 ms
7,992 KB
testcase_05 AC 15 ms
7,832 KB
testcase_06 AC 15 ms
7,880 KB
testcase_07 AC 14 ms
7,840 KB
testcase_08 AC 13 ms
7,940 KB
testcase_09 AC 13 ms
7,948 KB
testcase_10 AC 13 ms
7,800 KB
testcase_11 AC 13 ms
7,916 KB
testcase_12 AC 14 ms
7,824 KB
testcase_13 AC 13 ms
7,852 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

a0, a1 = 4., 3.

if n == 0:
    an = a0
elif n == 1:
    an = a0

for i in range(2, n+1):
    an = -3 * a0 + (19. / 4) * a1
    a1, a0 = an, a1

print("{0:.10f}".format(an))
0