跳到正文

个人记录

iuhgyugy

coach_zhaxi约 1 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年7月24日
篇幅
约 1 分钟

版本

  1. v1当前
C++
#include<bits/stdc++.h>
using namespace std;
map<long long,int> t;
int main(){
	long long n;cin>>n;
	for(long long i=2;i*i<=n;i++){
		while(n%i==0){
			t[i]++;
			n/=i;
		}
	}
	if(n!=1) t[n]++;
	int m=0;
	for(auto it=t.begin();it!=t.end();it++){
		int num=it->second,cnt=1;
		while(num>=cnt){
			num-=cnt;
			cnt++;
		}
		m+=cnt-1;
	}
	cout<<m;
	return 0;
}
原文