結果

問題 No.3186 Big Order
ユーザー akakimidori
提出日時 2025-06-20 22:01:25
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 470 bytes
コンパイル時間 1,055 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 24,344 KB
最終ジャッジ日時 2025-06-20 22:01:36
合計ジャッジ時間 4,229 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other TLE * 1 -- * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())
#print(t)

for i in range(0, t):
    v = [int(s) for s in input().split()]
    a, b, c = v[0], v[1], v[2]
    ans = 0
    cnt = 0
    while a % c == 0:
        a = a // c
        cnt += 1
    while b > 0:
        if b % 2 == 1:
            ans += cnt
            ans %= 998244353
        a = a * a
        cnt *= 2
        cnt %= 998244353
        while a % c == 0:
            a = a // c
            cnt += 1
        b >>= 1
    print(ans % 998244353)
0