結果
問題 | No.2576 LCM Pattern |
ユーザー |
![]() |
提出日時 | 2023-12-23 12:37:17 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 565 bytes |
コンパイル時間 | 216 ms |
コンパイル使用メモリ | 82,128 KB |
実行使用メモリ | 85,156 KB |
最終ジャッジ日時 | 2024-09-27 12:21:34 |
合計ジャッジ時間 | 4,079 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 TLE * 1 -- * 16 |
ソースコード
from math import comb import collections def prime_factorize(n): a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) return a def n_fact(N): c = collections.Counter(prime_factorize(N)) return c N,M = map(int,input().split()) X = n_fact(M) ans = 1 for k,v in X.items(): tmp = 0 for i in range(N): tmp += comb(N, i) * v ** i ans *= tmp print(ans)