結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,796 KB
testcase_01 WA -
testcase_02 AC 14 ms
7,960 KB
testcase_03 AC 14 ms
7,772 KB
testcase_04 AC 13 ms
7,808 KB
testcase_05 AC 14 ms
7,908 KB
testcase_06 AC 13 ms
7,908 KB
testcase_07 AC 13 ms
7,776 KB
testcase_08 AC 13 ms
7,804 KB
testcase_09 AC 12 ms
7,884 KB
testcase_10 AC 13 ms
7,968 KB
testcase_11 AC 13 ms
7,912 KB
testcase_12 AC 14 ms
7,976 KB
testcase_13 AC 14 ms
7,860 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 14 ms
7,972 KB
testcase_18 AC 13 ms
7,880 KB
testcase_19 AC 13 ms
7,868 KB
権限があれば一括ダウンロードができます

ソースコード

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
    if an < 10 ** -9:
        an = 0
        break

print(an)
0