結果

問題 No.106 素数が嫌い!2
ユーザー msm1993msm1993
提出日時 2020-11-18 16:45:54
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 23 ms / 5,000 ms
コード長 193 bytes
コンパイル時間 1,449 ms
コンパイル使用メモリ 165,904 KB
実行使用メモリ 10,836 KB
最終ジャッジ日時 2023-09-30 15:06:48
合計ジャッジ時間 2,362 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
10,836 KB
testcase_01 AC 4 ms
10,532 KB
testcase_02 AC 4 ms
10,804 KB
testcase_03 AC 5 ms
10,704 KB
testcase_04 AC 11 ms
10,760 KB
testcase_05 AC 22 ms
10,748 KB
testcase_06 AC 23 ms
10,516 KB
testcase_07 AC 22 ms
10,636 KB
testcase_08 AC 5 ms
10,528 KB
testcase_09 AC 6 ms
10,788 KB
testcase_10 AC 22 ms
10,692 KB
testcase_11 AC 11 ms
10,788 KB
testcase_12 AC 21 ms
10,732 KB
testcase_13 AC 4 ms
10,628 KB
testcase_14 AC 5 ms
10,800 KB
testcase_15 AC 4 ms
10,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;int main(){int n,k,i=2,j,c=0;vector<int> y(2000001,0);cin>>n>>k;for(;i<=n;i++){if(y[i]==0){for(j=i;j<=n;j+=i){y[j]++;}}c+=(y[i]>=k);}cout<<c<<endl;}
0