結果
問題 | 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 combimport collectionsdef prime_factorize(n):a = []while n % 2 == 0:a.append(2)n //= 2f = 3while f * f <= n:if n % f == 0:a.append(f)n //= felse:f += 2if n != 1:a.append(n)return adef n_fact(N):c = collections.Counter(prime_factorize(N))return cN,M = map(int,input().split())X = n_fact(M)ans = 1for k,v in X.items():tmp = 0for i in range(N):tmp += comb(N, i) * v ** ians *= tmpprint(ans)