結果
| 問題 | No.915 Plus Or Multiple Operation |
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2025-03-06 08:45:12 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 2,000 ms |
| コード長 | 258 bytes |
| 記録 | |
| コンパイル時間 | 225 ms |
| コンパイル使用メモリ | 95,596 KB |
| 実行使用メモリ | 78,976 KB |
| 最終ジャッジ日時 | 2026-07-06 21:33:53 |
| 合計ジャッジ時間 | 1,979 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
T=int(input())
for _ in range(T):
a,b,c=map(int,input().split())
if c==1:
print(-1)
continue
if a<c:
print(b)
continue
d=[]
while a>0:
d+=[a%c]
a//=c
print((len(d)-1+len(d)-d.count(0)-(d[-1]==1 and c-1>d[-2]>0 and c>2))*b)
sasa8uyauya