結果

問題 No.106 素数が嫌い!2
ユーザー gigurururugigurururu
提出日時 2014-12-18 23:42:16
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,583 ms / 5,000 ms
コード長 111 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 11,540 KB
実行使用メモリ 62,236 KB
最終ジャッジ日時 2023-08-27 05:24:49
合計ジャッジ時間 13,552 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 860 ms
38,616 KB
testcase_01 AC 93 ms
15,312 KB
testcase_02 AC 93 ms
15,404 KB
testcase_03 AC 93 ms
15,284 KB
testcase_04 AC 857 ms
38,528 KB
testcase_05 AC 1,573 ms
62,236 KB
testcase_06 AC 1,576 ms
62,096 KB
testcase_07 AC 1,580 ms
62,188 KB
testcase_08 AC 181 ms
18,496 KB
testcase_09 AC 185 ms
18,624 KB
testcase_10 AC 1,583 ms
62,028 KB
testcase_11 AC 796 ms
36,092 KB
testcase_12 AC 1,521 ms
60,376 KB
testcase_13 AC 95 ms
15,136 KB
testcase_14 AC 95 ms
15,292 KB
testcase_15 AC 96 ms
15,292 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require'prime'
N,K=gets.split.map &:to_i
c=[0]*N*2
Prime.each(N){|i|i.step(N,i){|j|c[j]+=1}}
p c.count{|i|i>=K}
0