結果
問題 | No.106 素数が嫌い!2 |
ユーザー | mai |
提出日時 | 2018-01-23 20:14:50 |
言語 | cLay (20240104-1) |
結果 |
WA
|
実行時間 | - |
コード長 | 432 bytes |
コンパイル時間 | 2,725 ms |
コンパイル使用メモリ | 162,028 KB |
実行使用メモリ | 10,980 KB |
最終ジャッジ日時 | 2023-09-18 23:53:05 |
合計ジャッジ時間 | 3,817 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | AC | 2 ms
4,380 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 14 ms
10,724 KB |
testcase_07 | AC | 14 ms
10,712 KB |
testcase_08 | WA | - |
testcase_09 | AC | 3 ms
4,380 KB |
testcase_10 | AC | 15 ms
10,704 KB |
testcase_11 | AC | 7 ms
6,300 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 1 ms
4,380 KB |
testcase_15 | AC | 1 ms
4,380 KB |
ソースコード
void gen_primelist(vector<int>& out, ll high) { out.resize(high + 1); out[0] = out[1] = 1; ll sqh = (ll)sqrt(high); for (ll i = 2; i <= sqh; 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); }