結果

問題 No.3108 徐々におかしくなる数学クイズ
ユーザー MasKoaTSMasKoaTS
提出日時 2023-12-31 19:05:54
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 335 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 81,480 KB
最終ジャッジ日時 2023-12-31 19:05:57
合計ジャッジ時間 2,939 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

# WA(?)

import sys
from decimal import Decimal, ROUND_HALF_UP
dec = Decimal
input = sys.stdin.readline
MOD = 998244353

def get_fib(n):
    r5 = dec(5) ** dec(0.5)
    d1, d2 = dec(1), dec(2)
    return (d1 / r5 * (((d1 + r5) / d2) ** n - ((d1 - r5) / d2) ** n)).quantize(dec('0'), ROUND_HALF_UP) % MOD


print(get_fib(dec(input())))
0