結果
| 問題 |
No.673 カブトムシ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-08-11 19:20:00 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,111 bytes |
| コンパイル時間 | 304 ms |
| コンパイル使用メモリ | 12,288 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2025-08-11 19:20:02 |
| 合計ジャッジ時間 | 2,060 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 5 WA * 9 |
ソースコード
import sys
MOD = 1000000007
class ModInt:
def __init__(self, x):
self.x = x % MOD
def __str__(self):
return str(self.x)
__repr__ = __str__
def __add__(self, other):
if isinstance(other, ModInt):
return ModInt(self.x + other.x)
else:
return ModInt(self.x + other)
def __sub__(self, other):
if isinstance(other, ModInt):
return ModInt(self.x - other.x)
else:
return ModInt(self.x - other)
def __mul__(self, other):
if isinstance(other, ModInt):
return ModInt(self.x * other.x)
else:
return ModInt(self.x * other)
def __truediv__(self, other):
if isinstance(other, ModInt):
return ModInt(self.x * pow(other.x, MOD - 2, MOD))
else:
return ModInt(self.x * pow(other, MOD - 2, MOD))
def __pow__(self, other):
if isinstance(other, ModInt):
return ModInt(pow(self.x, other.x, MOD))
else:
return ModInt(pow(self.x, other, MOD))
__radd__ = __add__
def __rsub__(self, other):
if isinstance(other, ModInt):
return ModInt(other.x - self.x)
else:
return ModInt(other - self.x)
__rmul__ = __mul__
def __rtruediv__(self, other):
if isinstance(other, ModInt):
return ModInt(other.x * pow(self.x, MOD - 2, MOD))
else:
return ModInt(other * pow(self.x, MOD - 2, MOD))
def __rpow__(self, other):
if isinstance(other, ModInt):
return ModInt(pow(other.x, self.x, MOD))
else:
return ModInt(pow(other, self.x, MOD))
def main():
# sys.setrecursionlimit(100000)
input = lambda: sys.stdin.readline()[:-1]
B, C, D = map(ModInt, map(int, input().split()))
if C == 1:
ans = B * D
else:
ans = B * ((C**D) - 1) / (C - 1) * C
print(ans)
if not __debug__:
f = open(sys.argv[1], "r")
sys.stdin = f
# try:
# sys.set_int_max_str_digits(100000)
# except AttributeError:
# pass
main()