結果

問題 No.673 カブトムシ
ユーザー RiburaRibura
提出日時 2020-05-19 22:20:38
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-01 23:06:38
合計ジャッジ時間 1,386 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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 % mod) * modinv(c - 1, mod) % mod)
0