শনিবার, ২ মার্চ, ২০১৩

Solution Of Light Online Judge 1236 - 1236 - Pairs Forming LCM

Problem Statement :

       The meaning of the questions: given n, now requires the least common multiple of the logarithm of n. 

Solution Idea : 
          1. factorize n, 
          2. n can be written as in the form of  ^ (K1) * P2 ^ (K2) ........ PM * (km) 
          3. Then the answer is ((2k1 +1) * (2k2 +1) * ....... (2km +1) +1) / 2.
          4. Its principle is separately for each factor to see 2 * k +1, and then for each factor.
          5.  Multiplying all factors, so that the last draw answers, each pair calculated twice (addition <n,n> the),
         6.  the final answer (ANS +1) / 2;

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন