結果

問題 No.1049 Zero (Exhaust)
ユーザー hedwig100hedwig100
提出日時 2020-05-08 22:01:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 258 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 10,700 KB
実行使用メモリ 47,288 KB
最終ジャッジ日時 2023-09-17 02:48:55
合計ジャッジ時間 27,692 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,928 KB
testcase_01 AC 13 ms
7,780 KB
testcase_02 AC 13 ms
7,768 KB
testcase_03 AC 1,297 ms
34,540 KB
testcase_04 AC 13 ms
7,812 KB
testcase_05 AC 1,061 ms
29,876 KB
testcase_06 AC 1,984 ms
47,220 KB
testcase_07 AC 221 ms
12,860 KB
testcase_08 AC 545 ms
19,292 KB
testcase_09 AC 1,444 ms
37,400 KB
testcase_10 AC 1,628 ms
39,948 KB
testcase_11 AC 1,634 ms
39,944 KB
testcase_12 AC 1,962 ms
45,196 KB
testcase_13 AC 389 ms
16,236 KB
testcase_14 AC 800 ms
24,520 KB
testcase_15 AC 1,357 ms
35,364 KB
testcase_16 AC 1,078 ms
30,076 KB
testcase_17 AC 1,140 ms
31,200 KB
testcase_18 AC 1,660 ms
40,528 KB
testcase_19 AC 1,385 ms
35,476 KB
testcase_20 AC 535 ms
19,348 KB
testcase_21 AC 1,468 ms
36,328 KB
testcase_22 AC 789 ms
23,808 KB
testcase_23 TLE -
testcase_24 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 **9 + 7
def main():
    p,K = map(int,input().split())
    dp = [0] * (K + 1)
    dp[0] = 1
    for i in range(K):
        dp[i + 1] = (p - 1)*dp[i] + 2*pow(2*p,i,MOD)
        dp[i + 1] %= MOD
    print(dp[-1])
if __name__ == '__main__':
    main()
0