結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー suppy193suppy193
提出日時 2017-01-31 14:47:39
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 220 bytes
コンパイル時間 584 ms
コンパイル使用メモリ 11,192 KB
実行使用メモリ 15,652 KB
最終ジャッジ日時 2023-08-25 14:14:11
合計ジャッジ時間 12,389 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
15,328 KB
testcase_01 AC 94 ms
15,204 KB
testcase_02 AC 198 ms
15,152 KB
testcase_03 AC 176 ms
15,560 KB
testcase_04 AC 108 ms
15,408 KB
testcase_05 AC 94 ms
15,168 KB
testcase_06 AC 98 ms
15,192 KB
testcase_07 AC 98 ms
15,392 KB
testcase_08 AC 100 ms
15,416 KB
testcase_09 AC 95 ms
15,212 KB
testcase_10 AC 94 ms
15,152 KB
testcase_11 AC 98 ms
15,268 KB
testcase_12 AC 96 ms
15,352 KB
testcase_13 AC 95 ms
15,280 KB
testcase_14 AC 96 ms
15,452 KB
testcase_15 AC 99 ms
15,292 KB
testcase_16 AC 96 ms
15,400 KB
testcase_17 AC 98 ms
15,352 KB
testcase_18 AC 97 ms
15,352 KB
testcase_19 AC 401 ms
15,480 KB
testcase_20 TLE -
testcase_21 AC 99 ms
15,092 KB
testcase_22 AC 94 ms
15,152 KB
testcase_23 AC 92 ms
15,372 KB
testcase_24 AC 127 ms
15,292 KB
testcase_25 TLE -
testcase_26 AC 93 ms
15,372 KB
testcase_27 AC 93 ms
15,184 KB
testcase_28 AC 94 ms
15,552 KB
testcase_29 AC 95 ms
15,084 KB
testcase_30 AC 94 ms
15,192 KB
testcase_31 AC 94 ms
15,652 KB
testcase_32 AC 855 ms
15,648 KB
testcase_33 TLE -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'
n, l = gets.strip.split(' ').map(&:to_i)
d_max = l / (n - 1)
count = 0
if d_max >= 2
	count += l - 2 * (n - 1) + 1
end
i = 3
while i <= d_max
	count += l - i * (n - 1) + 1 if i.prime?

	i += 2
end
p count
0