結果

問題 No.53 悪の漸化式
コンテスト
ユーザー gew1fw
提出日時 2025-06-12 15:54:46
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 416 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 229 ms
コンパイル使用メモリ 95,848 KB
実行使用メモリ 91,136 KB
最終ジャッジ日時 2026-07-11 15:24:10
合計ジャッジ時間 5,011 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from decimal import Decimal, getcontext

getcontext().prec = 1000  # Set high precision to handle very small numbers accurately

n = int(input())

if n == 0:
    value = Decimal('4.00000000')
else:
    numerator = 3 ** n
    denominator = 4 ** (n - 1)
    value = Decimal(numerator) / Decimal(denominator)

# Format the output to exactly 8 decimal places
formatted_value = format(value, '.8f')
print(formatted_value)
0