結果

問題 No.106 素数が嫌い!2
ユーザー maimai
提出日時 2018-01-23 20:33:28
言語 cLay
(20241019-1)
結果
WA  
実行時間 -
コード長 403 bytes
コンパイル時間 2,136 ms
コンパイル使用メモリ 175,144 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-07-05 12:56:02
合計ジャッジ時間 2,969 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 11 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

void gen_primelist(vector<int>& out, ll high) {
    out.resize(high + 1);
    out[0] = out[1] = 1;
    for (ll i = 2; i <= high; i++) {
        if (out[i] == 0) {
            for (ll j = i; j <= high; j += i) { // i*i
                out[j] += 1;
            }
        }
    }
}


{
    ll N,K;rd(N,K);
    vector<int> p;
    gen_primelist(p,N);
    ll cnt=0;
    REP(i,N+1) cnt+=p[i]>=K;
    wt(cnt);
}
0