結果

問題 No.106 素数が嫌い!2
ユーザー nanaenanae
提出日時 2017-03-19 14:28:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 308 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 10,516 KB
実行使用メモリ 23,580 KB
最終ジャッジ日時 2023-09-18 07:25:52
合計ジャッジ時間 5,675 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,032 KB
testcase_01 WA -
testcase_02 AC 15 ms
7,712 KB
testcase_03 AC 15 ms
7,992 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 734 ms
23,564 KB
testcase_07 AC 749 ms
23,572 KB
testcase_08 WA -
testcase_09 AC 60 ms
8,916 KB
testcase_10 AC 743 ms
23,580 KB
testcase_11 AC 324 ms
14,940 KB
testcase_12 WA -
testcase_13 AC 15 ms
7,996 KB
testcase_14 AC 15 ms
7,840 KB
testcase_15 AC 16 ms
7,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())

if K == 1:
    print(N - 2 + 1)
    quit()

dp = [0] * (N + 1)

for p in range(2, N + 1):
    if p**2 > N:
        break
    if dp[p] > 0:
        continue
    for m in range(p, N + 1, p):
        dp[m] += 1

ans = 0

for d in dp:
    if d >= K:
        ans += 1

print(ans)
0