結果

問題 No.106 素数が嫌い!2
ユーザー dnishdnish
提出日時 2017-07-09 01:39:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 1,661 ms
コンパイル使用メモリ 162,292 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-04-16 06:45:30
合計ジャッジ時間 2,506 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 22 ms
11,392 KB
testcase_07 AC 23 ms
11,264 KB
testcase_08 WA -
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 23 ms
11,520 KB
testcase_11 AC 8 ms
6,912 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=(n);i<(int) N;i++)
#define p(s) cout<<(s)<<endl
using namespace std;

int cnt[2000100];
int main(){
	int N,K;
	cin>>N>>K;
	for(int i=2;i*i<=N;i++){
		if(cnt[i]==0) for(int j=i;j<=N;j+=i) cnt[j]++;
	}
	int ans=0;
	REP(i,2,N+1){
		ans+=cnt[i]>=K;
	}
	p(ans);
	return 0;
}
0