結果

問題 No.673 カブトムシ
ユーザー Ribura
提出日時 2020-05-19 22:17:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 379 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-10-01 23:06:37
合計ジャッジ時間 1,348 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


def modinv(a, mod=10 ** 9 + 7):
    return pow(a, mod - 2, mod)


b, c, d = map(int, readline().split())
mod = 10 ** 9 + 7
if c == 1:
    print(b * d % mod)
else:
    print(b * (pow(c, d + 1, mod) - c) * modinv(c - 1, mod) % mod)
0