結果
| 問題 | No.106 素数が嫌い!2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-25 03:07:48 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 17 ms / 5,000 ms |
| コード長 | 399 bytes |
| 記録 | |
| コンパイル時間 | 356 ms |
| コンパイル使用メモリ | 79,224 KB |
| 実行使用メモリ | 11,240 KB |
| 最終ジャッジ日時 | 2026-03-27 19:56:49 |
| 合計ジャッジ時間 | 1,227 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
using namespace std;
int main() {
int n, k;
int ans = 0;
cin >> n >> k;
vector<int> a(n + 1, 0);
for (int i = 2; i <= n; i++) {
if (a[i] == 0) {
for (int j = i; j <= n; j += i) {
a[j]++;
}
}
if (a[i] >= k) {
ans++;
}
}
cout << ans << endl;
return 0;
}