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

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

Could someone help me in solving this problem : https://www.codechef.com/LOCMAY18/problems/DSERIES ? Here is my solution which, obviously, TLE'ed : https://www.codechef.com/viewsolution/18677401 . Also, it would be great if you could point me to some, other similar problems. Thanks!

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

»
6 лет назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

If you indagate in this sums: you will able to prove that solution is: .

Then we can chancge the original problem to which has as solution:

. This can be calculated in O(t) which is good enough

  • »
    »
    6 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

    Thanks a lot for the answer. It's clear to me now. I was , initially, able to come up with the first relation. Couldn't get to the second. Could you point me to questions involving a similar logic? Also, shouldn't there be (t+1)! in the denominator in the final answer cbosch_carlgauss?

    • »
      »
      »
      6 лет назад, # ^ |
      Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

      I solve similar problems before but I don't recall where, a good place to seek is here and hackerrank, also of course codechef is great I have like 14 math problems in my codechef todo.

      In the other hand, no the solution does not involve a inverse of a factorial, is only rhe solution of the first sum without the first term of that sum, but that term is so the answer is exactly what I said before.

      Sorry there was a little mistake, is fixed already hit023