Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ll n;cin>>n;
- map<ll,ll>mp;
- for(ll i=2; i<=n; i++){
- ll tmp = i;
- for(ll j=2; j*j<=tmp; j++){
- if(tmp%j == 0){
- while(tmp%j == 0){
- mp[j]++;
- tmp/=j;
- }
- }
- }
- if(tmp>1)mp[tmp]++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement