結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー simansiman
提出日時 2021-08-06 19:57:10
言語 Ruby
(3.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 147 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 11,844 KB
実行使用メモリ 27,992 KB
最終ジャッジ日時 2023-10-17 01:57:51
合計ジャッジ時間 10,271 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
16,224 KB
testcase_01 AC 90 ms
16,224 KB
testcase_02 AC 90 ms
16,224 KB
testcase_03 AC 123 ms
16,980 KB
testcase_04 AC 92 ms
16,228 KB
testcase_05 AC 97 ms
16,228 KB
testcase_06 AC 92 ms
16,228 KB
testcase_07 AC 92 ms
16,232 KB
testcase_08 AC 93 ms
16,228 KB
testcase_09 AC 90 ms
16,228 KB
testcase_10 AC 93 ms
16,228 KB
testcase_11 AC 91 ms
16,228 KB
testcase_12 AC 94 ms
16,228 KB
testcase_13 AC 91 ms
16,228 KB
testcase_14 AC 92 ms
16,228 KB
testcase_15 AC 92 ms
16,228 KB
testcase_16 AC 92 ms
16,228 KB
testcase_17 AC 92 ms
16,228 KB
testcase_18 AC 91 ms
16,228 KB
testcase_19 AC 220 ms
18,820 KB
testcase_20 AC 360 ms
21,076 KB
testcase_21 AC 92 ms
16,228 KB
testcase_22 AC 92 ms
16,228 KB
testcase_23 AC 92 ms
16,228 KB
testcase_24 AC 92 ms
16,228 KB
testcase_25 AC 527 ms
23,268 KB
testcase_26 AC 93 ms
16,228 KB
testcase_27 AC 92 ms
16,228 KB
testcase_28 AC 92 ms
16,228 KB
testcase_29 AC 94 ms
16,228 KB
testcase_30 AC 93 ms
16,228 KB
testcase_31 AC 98 ms
16,228 KB
testcase_32 AC 353 ms
21,068 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 AC 528 ms
23,268 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'

N, L = gets.split.map(&:to_i)
ans = 0

Prime.each(L) do |l|
  a = L - l * (N - 1) + 1
  break if a <= 0

  ans += a
end

puts ans
0