結果
問題 |
No.3186 Big Order
|
ユーザー |
|
提出日時 | 2025-06-20 21:57:26 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 435 bytes |
コンパイル時間 | 215 ms |
コンパイル使用メモリ | 82,356 KB |
実行使用メモリ | 58,772 KB |
最終ジャッジ日時 | 2025-06-20 21:57:29 |
合計ジャッジ時間 | 2,660 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 WA * 23 |
ソースコード
MOD = 998244353 def solve(): A, B, C = map(int, input().split()) if pow(A, B, C) != 0: print(0) return x = A % C l = [x] while x: x *= x x %= C l.append(x) t = 0 x = 1 for i in reversed(range(len(l) - 1)): y = x * l[i] % C if y: t |= 1 << i x = y print(B // (t + 1) % MOD) for _ in range(int(input())): solve()