結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
17,792 KB
testcase_01 AC 112 ms
12,288 KB
testcase_02 AC 115 ms
12,416 KB
testcase_03 WA -
testcase_04 AC 110 ms
12,160 KB
testcase_05 AC 109 ms
12,416 KB
testcase_06 AC 108 ms
12,416 KB
testcase_07 AC 110 ms
12,416 KB
testcase_08 AC 109 ms
12,416 KB
testcase_09 AC 113 ms
12,288 KB
testcase_10 AC 110 ms
12,416 KB
testcase_11 RE -
testcase_12 AC 110 ms
12,288 KB
testcase_13 AC 109 ms
12,160 KB
testcase_14 AC 109 ms
12,416 KB
testcase_15 RE -
testcase_16 AC 109 ms
12,416 KB
testcase_17 AC 113 ms
12,416 KB
testcase_18 AC 112 ms
12,288 KB
testcase_19 AC 110 ms
12,288 KB
testcase_20 RE -
testcase_21 AC 111 ms
12,288 KB
testcase_22 TLE -
testcase_23 AC 112 ms
12,544 KB
testcase_24 AC 124 ms
12,544 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?
	(h/j).downto(l/j){|i|
		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