maximum power of a prime number d that can divide n!
Difference between en1 and en2, changed 6 character(s)
why↵
long long k =d ,cc=0 ;↵
while(n >=k) cc += (n/k
k) ,k *=d; is wrong ↵

while this is correct ↵
long long k =d ,cc=0 ;↵
while(n) cc +=n/
dk , n /=k ;

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English dra2421 2020-05-31 21:12:14 6
en1 English dra2421 2020-05-30 19:22:53 204 Initial revision (published)