文章
19
粉丝
21
获赞
5
访问
19.0k
# include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PII;
vector<PII> divide_prime(ll n){
vector<PII> ans;
if (n == 1){ // 注意1要特判
ans.push_back({1,1});
return ans;
}
for (int i = 2; i <= n / i; ++i){
if (n % i == 0){
ll s = 0;
while (n % i == 0){
s ++;
n /= i;
}
ans.push_back({i,s});
}
}
if (n > 1) ans.push_back({n,1});
return ans;
}
int main (void){
ll n;
cin >> n;
vector<PII> ans = divide_prime(n);
cout << n << "=";
for (int i = 0; ...
登录后发布评论
暂无评论,来抢沙发