結果
問題 |
No.106 素数が嫌い!2
|
ユーザー |
![]() |
提出日時 | 2020-03-28 12:57:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 267 bytes |
コンパイル時間 | 1,421 ms |
コンパイル使用メモリ | 160,460 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-01-02 11:03:25 |
合計ジャッジ時間 | 3,817 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 3 RE * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; int have[123456]; 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; }