結果

問題 No.106 素数が嫌い!2
ユーザー maimai
提出日時 2018-01-23 20:36:37
言語 cLay
(20240104-1)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 405 bytes
コンパイル時間 1,665 ms
コンパイル使用メモリ 161,728 KB
実行使用メモリ 10,784 KB
最終ジャッジ日時 2023-09-18 23:54:47
合計ジャッジ時間 2,618 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,852 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 11 ms
6,996 KB
testcase_05 AC 20 ms
10,620 KB
testcase_06 AC 19 ms
10,784 KB
testcase_07 AC 19 ms
10,724 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 19 ms
10,700 KB
testcase_11 AC 10 ms
6,356 KB
testcase_12 AC 19 ms
10,516 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

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,2,N+1) cnt+=p[i]>=K;
    wt(cnt);
}
0