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

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

We can solve the question using the recurrence $$$dp[i][j]=dp[i−1][j−1]+dp[i−2][j−1]+.....+dp[1][j−1]$$$ where i is the index and j is the length of the sequence and using K BITs to speed up the calculation of the sum.

Is there any way to solve it using segment tree as a different approach?

Полный текст и комментарии »

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

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

Hi codeforces,

I'm trying to solve problem 372A ( Counting Kangaroos is Fun ), but i can't figure out what's wrong with my solution #50057680. What i am trying to do is sort the array and use two pointers to get the answer but i'm stuck on test case 6?

Полный текст и комментарии »

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