結果

問題 No.106 素数が嫌い!2
ユーザー xxxasdfghjkxxxasdfghjk
提出日時 2019-04-11 16:12:46
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 1,148 ms
コンパイル使用メモリ 157,680 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-18 15:31:00
合計ジャッジ時間 1,661 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int memo[2000002];
int main(){
  int N,K;
  cin >> N >> K;
  for(int i=0;i<200002;i++){
    memo[i] = 0;
  }
  for(int i=2;i<200002;i++){
    if(memo[i] == 0){
      for(int j=i;j<200002;j+=i)
        memo[j] += 1;
    }
  }
  int res = 0;
  for(int i=2;i<=N;i++){
    if(memo[i] >= K)
      res++;
  }
  cout << res << endl;
}
0