結果
| 問題 |
No.3186 Big Order
|
| コンテスト | |
| ユーザー |
yamate11
|
| 提出日時 | 2025-06-21 08:46:48 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 213 ms / 2,000 ms |
| コード長 | 509 bytes |
| コンパイル時間 | 411 ms |
| コンパイル使用メモリ | 82,156 KB |
| 実行使用メモリ | 75,660 KB |
| 最終ジャッジ日時 | 2025-06-21 08:46:55 |
| 合計ジャッジ時間 | 6,871 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 35 |
ソースコード
#!/usr/bin/env python3
P = 998244353
def solve():
A, B, C = map(int, input().split(' '))
lim = 135
j0 = 0
k0 = 1
powA = 1
j = 0
for k in range(1, lim + 1):
powA *= A
while True:
if powA % C != 0:
break
powA //= C
j += 1
if j * k0 > k * j0:
j0 = j
k0 = k
ans = (j0 * B) // k0
print(ans % P)
def main():
t = int(input())
for _ in range(t):
solve()
main()
yamate11