結果
問題 |
No.3186 Big Order
|
ユーザー |
![]() |
提出日時 | 2025-06-20 22:59:42 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 715 bytes |
コンパイル時間 | 452 ms |
コンパイル使用メモリ | 81,944 KB |
実行使用メモリ | 221,052 KB |
最終ジャッジ日時 | 2025-06-20 22:59:47 |
合計ジャッジ時間 | 4,385 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | TLE * 1 -- * 33 |
ソースコード
def get(a: int, b: int, c: int, d: int) -> int: res = 0 # a を d で割り切れるだけ割って、その回数を res に加える while a % d == 0: res += 1 a //= d ta = 1 for i in range(min(c, 150)): ta *= b if ta % d == 0: x = 0 while ta % d == 0: x += 1 ta //= d sub_c = c // (i + 1) sub_res = get(a * pow(b, c % (i + 1)), ta, sub_c, d) return x * sub_c + sub_res return res def main(): t = int(input()) for _ in range(t): A, B, C = map(int, input().split()) print(get(1, A, B, C)%998244353) if __name__ == "__main__": main()