結果

問題 No.106 素数が嫌い!2
ユーザー dangodango
提出日時 2023-07-21 21:54:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 152 ms / 5,000 ms
コード長 220 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 81,888 KB
実行使用メモリ 148,852 KB
最終ジャッジ日時 2023-10-21 21:55:05
合計ジャッジ時間 2,345 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
148,852 KB
testcase_01 AC 34 ms
53,492 KB
testcase_02 AC 34 ms
53,492 KB
testcase_03 AC 34 ms
53,492 KB
testcase_04 AC 108 ms
142,732 KB
testcase_05 AC 99 ms
93,064 KB
testcase_06 AC 104 ms
84,000 KB
testcase_07 AC 95 ms
84,000 KB
testcase_08 AC 51 ms
73,340 KB
testcase_09 AC 47 ms
63,340 KB
testcase_10 AC 91 ms
84,000 KB
testcase_11 AC 63 ms
71,168 KB
testcase_12 AC 152 ms
146,380 KB
testcase_13 AC 33 ms
53,492 KB
testcase_14 AC 34 ms
53,492 KB
testcase_15 AC 38 ms
59,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
n, k = map(int, input().split())
F = [0] * (n+1)
for i in range(2, n+1):
    if F[i] > 0:
        continue
    for j in range(i*2, n+1, i):
        F[j] += 1
    F[i] = 1
print(len([x for x in F if x >= k]))
0