結果

問題 No.811 約数の個数の最大化
ユーザー cielciel
提出日時 2019-04-20 15:04:05
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,213 ms / 2,000 ms
コード長 185 bytes
コンパイル時間 47 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 17,408 KB
最終ジャッジ日時 2024-04-08 16:52:08
合計ジャッジ時間 9,085 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
16,512 KB
testcase_01 AC 115 ms
16,512 KB
testcase_02 AC 1,118 ms
17,408 KB
testcase_03 AC 110 ms
16,512 KB
testcase_04 AC 106 ms
16,512 KB
testcase_05 AC 122 ms
16,640 KB
testcase_06 AC 160 ms
16,640 KB
testcase_07 AC 186 ms
16,640 KB
testcase_08 AC 542 ms
16,896 KB
testcase_09 AC 570 ms
16,896 KB
testcase_10 AC 394 ms
16,768 KB
testcase_11 AC 1,066 ms
17,408 KB
testcase_12 AC 328 ms
16,640 KB
testcase_13 AC 1,213 ms
17,408 KB
testcase_14 AC 1,207 ms
17,408 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require'prime'
n,k=gets.split.map &:to_i
r=t=0
o=Hash[n.prime_division]
(2...n).map{|i|
	q=i.prime_division
	l=s=1
	q.each{|n,p|l+=[o[n].to_i,p].min;s*=p+1}
	(l>k&&r<s)&&(r=s;t=i)
}
p t
0