結果

問題 No.3108 徐々におかしくなる数学クイズ
ユーザー MasKoaTSMasKoaTS
提出日時 2023-12-31 19:08:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 315 bytes
コンパイル時間 3,400 ms
コンパイル使用メモリ 81,444 KB
実行使用メモリ 79,304 KB
最終ジャッジ日時 2023-12-31 19:08:26
合計ジャッジ時間 2,504 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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 int(d1 / r5 * (((d1 + r5) / d2) ** n - ((d1 - r5) / d2) ** n) + dec(0.1)) % MOD


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