結果

問題 No.811 約数の個数の最大化
ユーザー roknaoroknao
提出日時 2019-04-12 23:10:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 509 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 11,000 KB
実行使用メモリ 29,876 KB
最終ジャッジ日時 2023-10-13 09:06:59
合計ジャッジ時間 5,718 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

"""
not correct
"""

import itertools as it
import numpy as np

def  prime_factrization(N):
	arr = []
	for i in range(2, N+1):
		while N%i==0:
			arr.append(i)
			N = N//i
		if N==1:
			return arr

def find_M(arr):
	ms = set(list(it.combinations(arr, len(arr)-1)))
	temp = 0
	M = 0
	for m in ms:
		if len(set(m)) > temp:
			temp = len(set(m))
			M = np.prod(m)
		elif len(set(m)) == temp and np.prod(m) < M:
			M = np.prod(m)
	


N, K = map(int, input().split())
arr = prime_factrization(N)
print(find_M(arr))
0