結果
| 問題 |
No.2750 Number of Prime Factors
|
| コンテスト | |
| ユーザー |
yumekawayui
|
| 提出日時 | 2024-05-12 16:31:54 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,231 bytes |
| コンパイル時間 | 3,654 ms |
| コンパイル使用メモリ | 278,120 KB |
| 実行使用メモリ | 250,892 KB |
| 最終ジャッジ日時 | 2024-12-20 09:09:41 |
| 合計ジャッジ時間 | 17,857 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 TLE * 1 |
| other | AC * 6 WA * 10 TLE * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
const vector<int> dx = {0, 0, 1, -1};
const vector<int> dy = {1, -1, 0, 0};
#define vec vector
#define int long long
#define double long double
//cout<<setprecision(15)<<fixed<<..
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define req(i, x, n) for (int i = x; i < (int)(n); i++)
#define pii pair<int,int>
#define pq priority_queue
#define all(V) begin(V),end(V)
#define printpair(p) cout<<p.first<<" "<<p.second<<"\n"
#define tple tuple<int,int,int>
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }
#define nexper(Z) next_permutation(all(Z))
#define pb push_back
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin>>n;
vec<bool> E(1e9+7,true);
E[1]=E[0]=false;
for(int i=2;i*i<=n;i++){
if(!E[i]){continue;}
for(int j=i+i;j*j<=n;j+=i){
E[j]=false;
}
}
int cur=1,cnt=0;
for(int i=2;i*i<=n;i++){
if(cur<=n/i){
cur*=i;
cnt++;
}
}
cout<<cnt<<"\n";
}
yumekawayui