結果

問題 No.371 ぼく悪いプライムじゃないよ
ユーザー cielciel
提出日時 2016-05-15 23:32:39
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 251 bytes
コンパイル時間 68 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 18,304 KB
最終ジャッジ日時 2024-04-15 22:16:08
合計ジャッジ時間 7,004 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
17,664 KB
testcase_01 AC 112 ms
12,288 KB
testcase_02 AC 108 ms
12,288 KB
testcase_03 AC 110 ms
12,416 KB
testcase_04 AC 111 ms
12,416 KB
testcase_05 AC 111 ms
12,416 KB
testcase_06 AC 110 ms
12,160 KB
testcase_07 AC 109 ms
12,288 KB
testcase_08 AC 111 ms
12,416 KB
testcase_09 AC 110 ms
12,416 KB
testcase_10 AC 111 ms
12,416 KB
testcase_11 AC 106 ms
12,416 KB
testcase_12 AC 111 ms
12,416 KB
testcase_13 AC 112 ms
12,288 KB
testcase_14 AC 109 ms
12,288 KB
testcase_15 AC 111 ms
12,416 KB
testcase_16 AC 111 ms
12,416 KB
testcase_17 AC 110 ms
12,288 KB
testcase_18 AC 109 ms
12,288 KB
testcase_19 AC 111 ms
12,288 KB
testcase_20 AC 129 ms
12,416 KB
testcase_21 AC 112 ms
12,416 KB
testcase_22 TLE -
testcase_23 AC 111 ms
12,544 KB
testcase_24 AC 123 ms
12,672 KB
testcase_25 TLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'
l,h=gets.split.map(&:to_i)
r=0;v=nil
j=Math.sqrt(h).to_i+1
while !v||j>=v
	j-=1
	next if h/j*j<l || !j.prime?
	i=h/j
	while i*j>=l
		t=(i*j).prime_division[0][0]
		if !v || v<t || (v==t&&r<i*j)
			v=t
			r=i*j
		end
		i-=1
	end
end
p r
0