結果
| 問題 | No.53 悪の漸化式 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-19 04:34:44 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 184 ms / 5,000 ms |
| + 312µs | |
| コード長 | 329 bytes |
| 記録 | |
| コンパイル時間 | 239 ms |
| コンパイル使用メモリ | 95,980 KB |
| 実行使用メモリ | 91,520 KB |
| 最終ジャッジ日時 | 2026-08-06 01:12:48 |
| 合計ジャッジ時間 | 5,836 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
from decimal import *
def main():
getcontext().prec = 100
n = int(input())
a = [0 for _ in range(101)]
a[0] = Decimal(4)
a[1] = Decimal(3)
for i in range(2, 101):
a[i] = (Decimal(19) * a[i-1] - Decimal(12) * a[i-2]) / Decimal(4)
print("{:.20f}".format(a[n]))
if __name__ == '__main__':
main()