結果
| 問題 | No.3186 Big Order |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-06-29 17:17:28 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 100 ms / 2,000 ms |
| + 33µs | |
| コード長 | 537 bytes |
| 記録 | |
| コンパイル時間 | 97 ms |
| コンパイル使用メモリ | 64,460 KB |
| 実行使用メモリ | 58,312 KB |
| 最終ジャッジ日時 | 2026-10-26 10:02:40 |
| 合計ジャッジ時間 | 5,137 ms |
|
ジャッジサーバーID (参考情報) |
judge7_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 37 |
ソースコード
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
# https://yukicoder.me/problems/no/3186
# The author read the solution before implementing this.
t = int(readline())
for _ in range(t):
a, b, c = map(int, readline().split())
opt_num, opt_den = 0, 1
x = 0
r = 1
for m in range(1, 133):
r *= a
while r % c == 0:
r //= c
x += 1
if opt_num * m < x * opt_den:
opt_num, opt_den = x, m
print(opt_num * b // opt_den % 998244353)