結果

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

ソースコード

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)
        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