結果
| 問題 | No.106 素数が嫌い!2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-26 06:21:51 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 940 ms / 5,000 ms |
| コード長 | 434 bytes |
| 記録 | |
| コンパイル時間 | 1,062 ms |
| コンパイル使用メモリ | 179,552 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-05 09:59:03 |
| 合計ジャッジ時間 | 7,761 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, k;
cin >> n >> k;
int ans = 0;
auto cnt = [] (int x) {
int c = 0;
for (int p = 2; p * p <= x; p++) {
c += x % p == 0;
while (x % p == 0) {
x /= p;
}
}
c += x != 1;
return c;
};
for (int i = 2; i <= n; i++) {
ans += cnt(i) >= k;
}
cout << ans << '\n';
return 0;
}