結果

問題 No.3186 Big Order
コンテスト
ユーザー koba-e964
提出日時 2025-06-29 17:15:21
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 559 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 261 ms
コンパイル使用メモリ 96,100 KB
実行使用メモリ 84,296 KB
最終ジャッジ日時 2026-07-12 23:15:11
合計ジャッジ時間 55,478 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 1 WA * 29 TLE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/env python3

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 = 1, 0
    for m in range(1, 133):
        x = 0
        r = a ** m
        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)
0