結果

問題 No.673 カブトムシ
ユーザー ああいい
提出日時 2022-05-19 09:18:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 222 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 53,728 KB
最終ジャッジ日時 2024-09-17 14:43:50
合計ジャッジ時間 1,386 ms
ジャッジサーバーID
(参考情報)
judge2 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

b,c,d = map(int,input().split())

import sys
P = 10 ** 9 + 7
c %= P
if c == 1:
    print(b * d % P)
else:
    c %= P
    b %= P
    t = pow(c,d,P) - 1
    inv = pow(c - 1,P-2,P)
    ans = t * inv * b * c % P
    print(ans)
0