結果
問題 |
No.2750 Number of Prime Factors
|
ユーザー |
|
提出日時 | 2024-06-08 21:08:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 562 bytes |
コンパイル時間 | 1,789 ms |
コンパイル使用メモリ | 170,924 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-28 13:58:43 |
合計ジャッジ時間 | 2,728 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 WA * 7 |
ソースコード
#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; }