結果
| 問題 |
No.368 LCM of K-products
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-13 18:20:45 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 552 bytes |
| コンパイル時間 | 413 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 18,336 KB |
| 最終ジャッジ日時 | 2024-06-25 18:59:08 |
| 合計ジャッジ時間 | 9,615 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 2 -- * 33 |
ソースコード
from collections import defaultdict
mp=defaultdict(list)
def factorize(x):
for i in range(2,40000):
ret=0
while x%i==0:
ret+=1
x//=i
if ret:
mp[i].append(ret)
if x>1:
mp[x].append(1)
N,K=map(int,input().split())
A=list(map(int,input().split()))
for i in range(N):
factorize(A[i])
mod=1000000007
ans=1
for k,v in mp.items():
list.sort(v)
list.reverse(v)
ret=0
for i in range(min(len(v),K)):
ret+=v[i]
ans=ans*pow(int(k),ret,mod)%mod
print(ans)