結果
問題 | No.106 素数が嫌い!2 |
ユーザー |
![]() |
提出日時 | 2020-03-28 12:58:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 22 ms / 5,000 ms |
コード長 | 268 bytes |
コンパイル時間 | 1,339 ms |
コンパイル使用メモリ | 159,672 KB |
実行使用メモリ | 11,456 KB |
最終ジャッジ日時 | 2025-01-02 11:03:32 |
合計ジャッジ時間 | 2,112 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h>using namespace std;int have[2234567];signed main(){int n,k;cin>>n>>k;for(int i=2;i<=n;i++){if(have[i])continue;for(int j=i;j<=n;j+=i)have[j]++;}int ans=0;for(int i=2;i<=n;i++)ans+=have[i]>=k;cout<<ans<<endl;}