結果

問題 No.106 素数が嫌い!2
ユーザー dnish
提出日時 2017-07-09 01:39:31
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 1,434 ms
コンパイル使用メモリ 166,968 KB
実行使用メモリ 11,308 KB
最終ジャッジ日時 2024-10-06 20:26:38
合計ジャッジ時間 2,144 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 6 WA * 7
権限があれば一括ダウンロードができます

ソースコード

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