結果

問題 No.980 Fibonacci Convolution Hard
ユーザー 37zigen37zigen
提出日時 2020-02-01 00:00:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 557 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 81,556 KB
実行使用メモリ 91,248 KB
最終ジャッジ日時 2023-10-17 13:59:12
合計ジャッジ時間 12,467 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 555 ms
91,248 KB
testcase_01 AC 548 ms
91,248 KB
testcase_02 AC 548 ms
91,248 KB
testcase_03 AC 550 ms
91,248 KB
testcase_04 AC 553 ms
91,248 KB
testcase_05 AC 545 ms
91,248 KB
testcase_06 AC 548 ms
91,248 KB
testcase_07 AC 554 ms
91,248 KB
testcase_08 AC 557 ms
91,248 KB
testcase_09 AC 554 ms
91,248 KB
testcase_10 AC 553 ms
91,248 KB
testcase_11 AC 551 ms
91,248 KB
testcase_12 AC 546 ms
91,248 KB
testcase_13 AC 549 ms
91,248 KB
testcase_14 AC 550 ms
91,248 KB
testcase_15 AC 555 ms
91,248 KB
testcase_16 AC 518 ms
91,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M=2000001
m=10**9+7
p=int(input())
b=[0]*M
b[4]=1
x=p*p%m
for i in range(5,M) : 
    b[i]=(2*p*b[i-1]+(2-x)*b[i-2]-2*p*b[i-3]-b[i-4])%m
q=int(input())
for i in range(q): 
    x=int(input())
    print((b[x]+m)%m)
0