結果

問題 No.811 約数の個数の最大化
ユーザー cielciel
提出日時 2019-04-13 14:33:36
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 236 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 11,376 KB
実行使用メモリ 15,556 KB
最終ジャッジ日時 2023-10-13 14:18:38
合計ジャッジ時間 8,353 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 98 ms
15,312 KB
testcase_02 AC 1,008 ms
15,412 KB
testcase_03 WA -
testcase_04 AC 97 ms
15,392 KB
testcase_05 AC 110 ms
15,484 KB
testcase_06 AC 150 ms
15,472 KB
testcase_07 AC 179 ms
15,384 KB
testcase_08 AC 508 ms
15,412 KB
testcase_09 AC 533 ms
15,300 KB
testcase_10 AC 366 ms
15,556 KB
testcase_11 AC 995 ms
15,440 KB
testcase_12 AC 303 ms
15,344 KB
testcase_13 AC 1,155 ms
15,512 KB
testcase_14 AC 1,150 ms
15,344 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require'prime'
n,k=gets.split.map &:to_i
r=rn=0
o=Hash[n.prime_division]
(2..n).each{|i|
	q=i.prime_division
	k0=k
	q.each{|n,p|k0-=[o[n].to_i,p].min}
	if k0<=0
		r0=q.map{|n,p|p+1}.reduce(:*)
		if r<r0
			r=r0
			rn=i
		end
	end
}
p rn
0