結果

問題 No.106 素数が嫌い!2
ユーザー 6soukiti296soukiti29
提出日時 2017-08-23 04:34:53
言語 Nim
(2.0.2)
結果
AC  
実行時間 64 ms / 5,000 ms
コード長 296 bytes
コンパイル時間 2,966 ms
コンパイル使用メモリ 68,260 KB
実行使用メモリ 18,752 KB
最終ジャッジ日時 2023-09-12 14:58:23
合計ジャッジ時間 4,490 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,748 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 26 ms
10,768 KB
testcase_05 AC 59 ms
18,752 KB
testcase_06 AC 63 ms
18,556 KB
testcase_07 AC 61 ms
18,740 KB
testcase_08 AC 5 ms
4,376 KB
testcase_09 AC 5 ms
4,380 KB
testcase_10 AC 60 ms
18,608 KB
testcase_11 AC 22 ms
9,852 KB
testcase_12 AC 64 ms
18,084 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sequtils,strutils
var
    Nn : array[1..2_000_000, int]
    N, K : int
    cnt : int
(N, K) = stdin.readline.split.map(parseInt)
for i in 2..N:
    if Nn[i] == 0:
        var j = i
        while j <= N:
            Nn[j] += 1
            j += i
    if Nn[i] >= K:
        cnt += 1
echo cnt
0