結果
| 問題 | No.915 Plus Or Multiple Operation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-30 09:40:14 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 92 ms / 2,000 ms |
| + 523µs | |
| コード長 | 297 bytes |
| 記録 | |
| コンパイル時間 | 291 ms |
| コンパイル使用メモリ | 21,412 KB |
| 実行使用メモリ | 15,860 KB |
| 最終ジャッジ日時 | 2026-07-25 09:16:00 |
| 合計ジャッジ時間 | 2,555 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
def solve(A, B, C):
if C == 1: return -1
res = 0
while A > 2 * C - 2:
A, mod = divmod(A, C)
res += B
if mod:
res += B
res += B if A < C else 2 * B
return res
Q = int(input())
for _ in range(Q):
print(solve(*map(int, input().split())))