結果
問題 |
No.3236 累乗数大好きbot
|
ユーザー |
![]() |
提出日時 | 2025-08-15 22:02:55 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 734 bytes |
コンパイル時間 | 267 ms |
コンパイル使用メモリ | 82,236 KB |
実行使用メモリ | 263,236 KB |
最終ジャッジ日時 | 2025-08-15 22:03:25 |
合計ジャッジ時間 | 13,332 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 6 TLE * 1 -- * 24 |
ソースコード
q = int(input()) from collections import defaultdict dict = defaultdict(int) k = 5*10**4 def prime(n): NP = [True for _ in range(n+1)] P = [] for i in range(2, n+1): if NP[i]: P.append(i) for j in range(i, n+1, i): NP[j] = False return P P = prime(k) NP = prime(10**6) N = 10**12 for now in range(len(P), len(NP)): t = 1 mow = NP[now] * NP[now] while mow * t <= N: dict[mow*t] = 1 t += 1 M = [int(input()) for _ in range(q)] for n in M: cnt = 1 for p in P: tmp = 0 while n % p == 0: tmp += 1 n //= p cnt = max(cnt, tmp) if dict[n]: cnt = max(cnt, 2) print(cnt)