結果

問題 No.106 素数が嫌い!2
ユーザー t98slidert98slider
提出日時 2020-11-09 20:56:50
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 23 ms / 5,000 ms
コード長 193 bytes
コンパイル時間 1,438 ms
コンパイル使用メモリ 164,620 KB
実行使用メモリ 10,760 KB
最終ジャッジ日時 2023-09-29 22:16:30
合計ジャッジ時間 2,455 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
10,556 KB
testcase_01 AC 5 ms
10,488 KB
testcase_02 AC 5 ms
10,760 KB
testcase_03 AC 4 ms
10,516 KB
testcase_04 AC 12 ms
10,548 KB
testcase_05 AC 23 ms
10,696 KB
testcase_06 AC 22 ms
10,640 KB
testcase_07 AC 22 ms
10,560 KB
testcase_08 AC 6 ms
10,700 KB
testcase_09 AC 5 ms
10,600 KB
testcase_10 AC 23 ms
10,684 KB
testcase_11 AC 11 ms
10,708 KB
testcase_12 AC 22 ms
10,760 KB
testcase_13 AC 4 ms
10,532 KB
testcase_14 AC 5 ms
10,528 KB
testcase_15 AC 4 ms
10,684 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