結果

問題 No.2750 Number of Prime Factors
ユーザー eve__fuyuki
提出日時 2024-05-10 21:26:50
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 518 bytes
コンパイル時間 2,001 ms
コンパイル使用メモリ 194,176 KB
最終ジャッジ日時 2025-02-21 12:13:32
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
void fast_io() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
}
int main() {
    fast_io();
    vector<long long> primes = {
        2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59,
    };
    long long n;
    cin >> n;
    int ans = 0;
    long long cur = 1;
    for (long long p : primes) {
        if (cur <= n / p) {
            cur *= p;
            ans++;
        } else {
            break;
        }
    }
    cout << ans << endl;
}
0