結果

問題 No.978 Fibonacci Convolution Easy
ユーザー realDivineJKrealDivineJK
提出日時 2020-05-20 21:37:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 210 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-09 23:07:34
合計ジャッジ時間 19,387 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
10,752 KB
testcase_01 AC 876 ms
10,752 KB
testcase_02 AC 477 ms
10,624 KB
testcase_03 TLE -
testcase_04 AC 566 ms
10,624 KB
testcase_05 AC 142 ms
10,624 KB
testcase_06 AC 762 ms
10,624 KB
testcase_07 AC 1,362 ms
10,752 KB
testcase_08 AC 936 ms
10,624 KB
testcase_09 AC 1,542 ms
10,624 KB
testcase_10 TLE -
testcase_11 AC 638 ms
10,752 KB
testcase_12 AC 128 ms
10,752 KB
testcase_13 AC 767 ms
10,624 KB
testcase_14 AC 226 ms
10,624 KB
testcase_15 AC 856 ms
10,624 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 AC 29 ms
10,624 KB
testcase_19 AC 29 ms
10,624 KB
testcase_20 AC 29 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, p = map(int, input().split())
mod = 1000000007

a, b = 0, 1
S = 0
SS = 0
tmp = 0
for i in range(N):
    S += a * SS % mod
    S %= mod
    a, b = b, (a + p * b) % mod
    SS += a % mod
    SS %= mod
print(S)
0