結果

問題 No.106 素数が嫌い!2
ユーザー threepipes_sthreepipes_s
提出日時 2016-01-03 03:26:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,172 ms / 5,000 ms
コード長 226 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 11,740 KB
実行使用メモリ 25,724 KB
最終ジャッジ日時 2023-10-19 14:34:54
合計ジャッジ時間 16,170 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,090 ms
17,912 KB
testcase_01 AC 31 ms
10,008 KB
testcase_02 AC 29 ms
10,008 KB
testcase_03 AC 30 ms
10,008 KB
testcase_04 AC 1,096 ms
17,912 KB
testcase_05 AC 2,048 ms
25,724 KB
testcase_06 AC 2,094 ms
25,724 KB
testcase_07 AC 2,030 ms
25,724 KB
testcase_08 AC 152 ms
11,140 KB
testcase_09 AC 154 ms
11,208 KB
testcase_10 AC 2,108 ms
25,724 KB
testcase_11 AC 878 ms
16,980 KB
testcase_12 AC 2,172 ms
25,092 KB
testcase_13 AC 30 ms
10,008 KB
testcase_14 AC 31 ms
10,008 KB
testcase_15 AC 31 ms
10,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
p = [0 for i in range(n+1)]
for i in range(2, n+1):
    if p[i]>0: continue
    j = i*2
    while j<=n:
        p[j] += 1
        j+=i
    p[i] = 1
c = 0
for i in p:
    if i>=k: c+=1
print(c)
0