結果

問題 No.1049 Zero (Exhaust)
ユーザー 👑 KazunKazun
提出日時 2021-02-19 04:52:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 149 bytes
コンパイル時間 1,024 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 76,084 KB
最終ジャッジ日時 2023-10-13 11:48:17
合計ジャッジ時間 4,999 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,512 KB
testcase_01 AC 74 ms
71,452 KB
testcase_02 AC 76 ms
71,160 KB
testcase_03 AC 83 ms
75,732 KB
testcase_04 AC 74 ms
71,260 KB
testcase_05 AC 83 ms
75,716 KB
testcase_06 AC 87 ms
75,888 KB
testcase_07 AC 79 ms
75,888 KB
testcase_08 AC 81 ms
75,932 KB
testcase_09 AC 83 ms
75,828 KB
testcase_10 AC 85 ms
75,884 KB
testcase_11 AC 84 ms
75,848 KB
testcase_12 AC 85 ms
76,084 KB
testcase_13 AC 81 ms
75,716 KB
testcase_14 AC 81 ms
75,984 KB
testcase_15 AC 85 ms
75,856 KB
testcase_16 AC 81 ms
75,868 KB
testcase_17 AC 81 ms
76,000 KB
testcase_18 AC 84 ms
75,996 KB
testcase_19 AC 82 ms
75,984 KB
testcase_20 AC 78 ms
76,012 KB
testcase_21 AC 84 ms
75,884 KB
testcase_22 AC 81 ms
75,904 KB
testcase_23 AC 86 ms
75,716 KB
testcase_24 AC 85 ms
76,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

P,K=map(int,input().split())
Mod=10**9+7

p_pow=1
x=1

for _ in range(1,K+1):
    x=(p_pow+P*x+(p_pow-x))%Mod
    p_pow*=2*P
    p_pow%=Mod

print(x)
0