Блог пользователя rahulpadhy

Автор rahulpadhy, история, 10 лет назад, По-английски

Can anyone tell me how to approach this question ? I have been trying it for quite sometime now, but to no avail.. The link to the question is : http://www.spoj.com/problems/EASYFACT/

  • Проголосовать: нравится
  • +13
  • Проголосовать: не нравится

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Any sum of consecutive integers can be described by a low value a and a length r. So we must have:

Try simplifying this expression and then factoring it.

  • »
    »
    10 лет назад, скрыть # ^ |
    ← Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    Can you please explain this one a bit more ? I had got this expression, but unable to proceed any further..

    • »
      »
      »
      10 лет назад, скрыть # ^ |
      ← Rev. 2  
      Проголосовать: нравится 0 Проголосовать: не нравится

      Sure. To get that first formula, notice that

      Simplifying the formula in my previous comment, we get

      2N! = r(r + 2a + 1).

      Instead of counting all pairs (r,a) we will count all pairs (r,r+2a+1) because it's simpler: now we're just counting all ordered pairs (x,y) with xy = 2N! where x<y and x and y have different parity.

      This is equivalent to counting the number of odd divisors of 2N!. I can explain the solution to this reduced problem if you're still stuck.