結果

問題 No.1049 Zero (Exhaust)
ユーザー ValkyrjaValkyrja
提出日時 2020-05-11 13:13:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 753 ms / 2,000 ms
コード長 126 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 10,652 KB
実行使用メモリ 7,892 KB
最終ジャッジ日時 2023-09-25 11:29:12
合計ジャッジ時間 11,728 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,788 KB
testcase_01 AC 15 ms
7,728 KB
testcase_02 AC 16 ms
7,884 KB
testcase_03 AC 464 ms
7,812 KB
testcase_04 AC 15 ms
7,740 KB
testcase_05 AC 362 ms
7,764 KB
testcase_06 AC 678 ms
7,760 KB
testcase_07 AC 95 ms
7,696 KB
testcase_08 AC 206 ms
7,848 KB
testcase_09 AC 505 ms
7,748 KB
testcase_10 AC 610 ms
7,768 KB
testcase_11 AC 594 ms
7,764 KB
testcase_12 AC 678 ms
7,728 KB
testcase_13 AC 152 ms
7,752 KB
testcase_14 AC 284 ms
7,744 KB
testcase_15 AC 452 ms
7,868 KB
testcase_16 AC 375 ms
7,760 KB
testcase_17 AC 374 ms
7,780 KB
testcase_18 AC 630 ms
7,748 KB
testcase_19 AC 518 ms
7,728 KB
testcase_20 AC 191 ms
7,764 KB
testcase_21 AC 532 ms
7,808 KB
testcase_22 AC 311 ms
7,772 KB
testcase_23 AC 744 ms
7,892 KB
testcase_24 AC 753 ms
7,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

p,k=map(int,input().split())
mod=10**9+7
a,b=1,0
for i in range(k):
    a,b=((p+1)*a+2*(p-1)*b)%mod,(a+2*(p-1)*b)%mod
print(a)
0