結果

問題 No.673 カブトムシ
ユーザー mkawa2mkawa2
提出日時 2020-01-08 09:23:44
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 284 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-07-02 21:30:45
合計ジャッジ時間 1,430 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
def MI(): return map(int, sys.stdin.readline().split())

def main():
    md = 10 ** 9 + 7
    b,c,d=MI()
    if c==1:
        print(b*d%md)
        exit()
    s=b*c*pow(c-1,md-2,md)
    ans=((b*c+s)*pow(c,d-1,md)-s)%md
    print(ans)
main()
0