結果
| 問題 |
No.915 Plus Or Multiple Operation
|
| コンテスト | |
| ユーザー |
simamumu
|
| 提出日時 | 2019-10-25 22:27:48 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 609 bytes |
| コンパイル時間 | 157 ms |
| コンパイル使用メモリ | 82,188 KB |
| 実行使用メモリ | 71,148 KB |
| 最終ジャッジ日時 | 2024-11-07 03:33:33 |
| 合計ジャッジ時間 | 1,908 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 6 WA * 4 |
ソースコード
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
Q = inp()
for q in range(Q):
A,B,C = inpl()
if C == 1:
print(A*B)
else:
ans = 0
while A > 1:
if A%C == 0:
A //= C
else:
A -= A%C
ans += B
print(ans)
simamumu