結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
12,416 KB
testcase_01 AC 111 ms
12,288 KB
testcase_02 RE -
testcase_03 AC 108 ms
12,416 KB
testcase_04 AC 118 ms
12,288 KB
testcase_05 AC 112 ms
12,160 KB
testcase_06 AC 107 ms
12,288 KB
testcase_07 AC 108 ms
12,288 KB
testcase_08 AC 114 ms
12,288 KB
testcase_09 WA -
testcase_10 AC 111 ms
12,160 KB
testcase_11 AC 114 ms
12,416 KB
testcase_12 AC 114 ms
12,288 KB
testcase_13 AC 115 ms
12,416 KB
testcase_14 WA -
testcase_15 AC 110 ms
12,544 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 117 ms
12,416 KB
testcase_21 AC 120 ms
12,544 KB
testcase_22 AC 128 ms
12,800 KB
testcase_23 AC 114 ms
12,288 KB
testcase_24 WA -
testcase_25 AC 146 ms
12,544 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 137 ms
12,544 KB
testcase_29 AC 219 ms
12,800 KB
testcase_30 AC 171 ms
12,544 KB
testcase_31 AC 131 ms
12,544 KB
testcase_32 AC 133 ms
12,416 KB
testcase_33 AC 140 ms
12,416 KB
testcase_34 AC 144 ms
12,416 KB
testcase_35 AC 138 ms
12,544 KB
testcase_36 AC 134 ms
12,544 KB
testcase_37 AC 162 ms
12,544 KB
testcase_38 AC 142 ms
12,672 KB
testcase_39 AC 190 ms
12,544 KB
testcase_40 AC 185 ms
12,544 KB
testcase_41 AC 212 ms
12,800 KB
testcase_42 AC 143 ms
12,672 KB
testcase_43 AC 165 ms
12,544 KB
testcase_44 AC 125 ms
12,672 KB
testcase_45 AC 111 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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?
	(h/j).downto(j){|i|
		break if i<l/j+1
		t=(i*j).prime_division[0][0]
		if !v || v<t || (v==t&&r<i*j)
			v=t
			r=i*j
		end
	}
end
p r
0