結果
| 問題 | No.915 Plus Or Multiple Operation |
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2024-04-17 16:12:23 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 325 bytes |
| 記録 | |
| コンパイル時間 | 179 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 65,280 KB |
| 最終ジャッジ日時 | 2026-04-25 13:06:25 |
| 合計ジャッジ時間 | 2,209 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 RE * 2 |
ソースコード
Q=int(input())
for q in range(Q):
A,B,C=map(int,input().split())
inf=1<<30
def solve(A):
retu=(A+C-2)//(C-1)*B
if A:
if A%C:
retu=min(retu,solve(A-A%C)+B)
else:
retu=min(retu,solve(A//C)+B)
return retu
ans=solve(A)
print(ans)
vwxyz