結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-07-10 20:25:07
言語 Ruby
(3.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 287 bytes
コンパイル時間 634 ms
コンパイル使用メモリ 11,340 KB
実行使用メモリ 29,436 KB
最終ジャッジ日時 2023-08-21 22:19:01
合計ジャッジ時間 9,953 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
15,104 KB
testcase_01 AC 91 ms
15,108 KB
testcase_02 AC 92 ms
15,104 KB
testcase_03 AC 126 ms
16,384 KB
testcase_04 AC 93 ms
15,284 KB
testcase_05 AC 91 ms
15,304 KB
testcase_06 AC 91 ms
15,312 KB
testcase_07 AC 92 ms
15,260 KB
testcase_08 AC 96 ms
15,192 KB
testcase_09 AC 90 ms
15,164 KB
testcase_10 AC 90 ms
15,208 KB
testcase_11 AC 93 ms
15,256 KB
testcase_12 AC 92 ms
15,284 KB
testcase_13 AC 92 ms
15,352 KB
testcase_14 AC 92 ms
15,232 KB
testcase_15 AC 93 ms
15,304 KB
testcase_16 AC 94 ms
15,024 KB
testcase_17 AC 92 ms
15,216 KB
testcase_18 AC 93 ms
15,112 KB
testcase_19 AC 231 ms
18,088 KB
testcase_20 AC 377 ms
21,048 KB
testcase_21 AC 91 ms
15,352 KB
testcase_22 AC 94 ms
15,332 KB
testcase_23 AC 90 ms
15,112 KB
testcase_24 AC 91 ms
15,108 KB
testcase_25 AC 556 ms
23,488 KB
testcase_26 AC 92 ms
15,280 KB
testcase_27 AC 93 ms
15,140 KB
testcase_28 AC 90 ms
15,344 KB
testcase_29 AC 95 ms
15,284 KB
testcase_30 AC 93 ms
15,100 KB
testcase_31 AC 94 ms
15,260 KB
testcase_32 AC 372 ms
20,996 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 AC 553 ms
23,712 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/env ruby

require "prime"


def count_seqs(n, l)
    d_max = l / (n - 1)
    if d_max < 2
        return 0
    end
    answer = Prime.each(d_max).map {|d|
        l - (n - 1) * d + 1
    }.inject(:+)
    return answer
end


n, l = gets.split.map(&:to_i)
puts count_seqs(n, l)
0