結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
12,544 KB
testcase_01 AC 99 ms
12,416 KB
testcase_02 AC 100 ms
12,416 KB
testcase_03 AC 99 ms
12,288 KB
testcase_04 AC 100 ms
12,544 KB
testcase_05 AC 102 ms
12,672 KB
testcase_06 AC 100 ms
12,416 KB
testcase_07 AC 99 ms
12,288 KB
testcase_08 AC 103 ms
12,672 KB
testcase_09 WA -
testcase_10 AC 100 ms
12,544 KB
testcase_11 AC 100 ms
12,288 KB
testcase_12 AC 99 ms
12,416 KB
testcase_13 AC 98 ms
12,288 KB
testcase_14 WA -
testcase_15 AC 102 ms
12,544 KB
testcase_16 RE -
testcase_17 AC 99 ms
12,416 KB
testcase_18 AC 103 ms
12,288 KB
testcase_19 WA -
testcase_20 AC 100 ms
12,544 KB
testcase_21 AC 99 ms
12,416 KB
testcase_22 AC 111 ms
12,544 KB
testcase_23 AC 100 ms
12,544 KB
testcase_24 WA -
testcase_25 AC 130 ms
12,672 KB
testcase_26 AC 105 ms
12,416 KB
testcase_27 WA -
testcase_28 AC 123 ms
12,672 KB
testcase_29 AC 196 ms
12,672 KB
testcase_30 AC 152 ms
12,544 KB
testcase_31 AC 122 ms
12,672 KB
testcase_32 AC 121 ms
12,544 KB
testcase_33 AC 130 ms
12,544 KB
testcase_34 AC 128 ms
12,800 KB
testcase_35 AC 123 ms
12,928 KB
testcase_36 AC 128 ms
12,544 KB
testcase_37 AC 146 ms
12,800 KB
testcase_38 AC 121 ms
12,672 KB
testcase_39 AC 175 ms
12,800 KB
testcase_40 AC 164 ms
12,800 KB
testcase_41 AC 186 ms
12,928 KB
testcase_42 AC 124 ms
12,672 KB
testcase_43 AC 148 ms
12,544 KB
testcase_44 AC 111 ms
12,672 KB
testcase_45 AC 101 ms
12,672 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+(i%j>0 ? 1 : 0)
		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