結果

問題 No.407 鴨等素数間隔列の数え上げ
ユーザー 👑 horiesinitihoriesiniti
提出日時 2018-03-30 18:49:08
言語 Ruby
(3.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 134 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 11,568 KB
実行使用メモリ 35,380 KB
最終ジャッジ日時 2023-09-08 07:17:12
合計ジャッジ時間 21,814 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,292 KB
testcase_01 AC 88 ms
15,160 KB
testcase_02 AC 85 ms
15,416 KB
testcase_03 AC 346 ms
20,816 KB
testcase_04 AC 90 ms
15,216 KB
testcase_05 TLE -
testcase_06 TLE -
testcase_07 AC 92 ms
15,332 KB
testcase_08 AC 96 ms
15,184 KB
testcase_09 AC 92 ms
15,152 KB
testcase_10 AC 93 ms
15,168 KB
testcase_11 AC 91 ms
15,336 KB
testcase_12 AC 110 ms
15,764 KB
testcase_13 AC 94 ms
15,376 KB
testcase_14 AC 99 ms
15,352 KB
testcase_15 AC 87 ms
15,252 KB
testcase_16 AC 85 ms
15,300 KB
testcase_17 AC 90 ms
15,388 KB
testcase_18 AC 88 ms
15,304 KB
testcase_19 AC 339 ms
20,880 KB
testcase_20 AC 673 ms
25,864 KB
testcase_21 AC 350 ms
20,812 KB
testcase_22 AC 337 ms
20,936 KB
testcase_23 AC 500 ms
23,452 KB
testcase_24 AC 683 ms
25,812 KB
testcase_25 TLE -
testcase_26 TLE -
testcase_27 AC 225 ms
18,416 KB
testcase_28 AC 546 ms
23,684 KB
testcase_29 TLE -
testcase_30 AC 364 ms
21,072 KB
testcase_31 AC 863 ms
27,788 KB
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'
n,l=gets.split.map{|e| e.to_i}
ps=Prime.each(l).to_a
ans=0
ps.each{|e|
	t=e*(n-1)
	break if t>l
	ans+=l-t+1
}
puts ans
0