階乗

1114C - Trailing Loves (or L'oeufs?) 〜階乗に含まれる素因数の数〜

Quiz https://codeforces.com/contest/1114/problem/C AC Code https://codeforces.com/contest/1114/submission/56636163 map<ll, ll> factorize(ll n){ map<ll, ll> mp; ll sq = sqrt(n); FOR(i, 2, sq+1){ while(n%i==0){ mp[i]++; n/=i; } } // 残り if(n!=1){ mp[n]++; </ll,></ll,>…