結果

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;}
template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;}

const int P[15]={2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
	ll N;
	cin>>N;
	ll M=1;
	for(int i=0;i<15;i++){
		if(M*P[i]>N){
			cout<<i<<"\n";
			return 0;
		}
		M*=P[i];
	}
	cout<<15<<"\n";
}
0