結果
| 問題 |
No.2750 Number of Prime Factors
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-08 21:11:15 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 563 bytes |
| コンパイル時間 | 4,811 ms |
| コンパイル使用メモリ | 169,748 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-28 14:03:37 |
| 合計ジャッジ時間 | 2,668 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
vector<int> eratosthenes(int n) {
vector<bool> prime(n+1, true);
vector<int> p;
prime[0] = false;
prime[1] = false;
for (int i = 2; i <= n; i++) {
if (!prime[i])
continue;
p.push_back(i);
for (int j = i*2; j <= n; j += i)
prime[j] = false;
}
return p;
}
int main() {
ll N;
cin >> N;
vector<int> p = eratosthenes(60);
ll po = 1;
int n = 0;
while (po * p[n] <= N && n < 15) {
po *= p[n];
n++;
}
cout << n << endl;
return 0;
}