Hello Codeforces Community!!!
I invite you all to take part in HackerEarth's April Easy contest. The contest will be held on 1st April,2018 at 22:00 IST.
Problems have been set by coderdecode1, rhezo and killjee and tested by me(prat33k) and real_flash.
You will be given 5 algorithmic problems to solve in 3 hours. Partial scoring will be used (you get points for passing each test case). Although the contest is targeted towards beginners, we hope even experienced problem-solvers find one or two problems to be interesting. The contest is rated and prizes will be awarded to the top 3 beginners(i.e. Programmers with a rating of 1600 or less before the challenge starts).
Good luck and have fun.
Update: Contest has started. All the best :)
Really exciting problems ! Please do take part :)
https://www.hackerearth.com/practice/algorithms/dynamic-programming/2-dimensional/practice-problems/algorithm/rhezo-and-special-gift-2882de10/editorial/ i didnt get logic for using frequency in matrix exponentiation, can someone explain...
dp[i]=dp[i-A[1]] +dp[i-A[2]] + .... dp[i-A[m]] can be written as
dp[i]=F[1]*dp[i-1]+F[2]*dp[i-2]+F[3]*dp[i-3]+.... F[A[m]] * dp[i-A[m]] where A[m] is the largest number in the array . So this recursion is linear so we can find dp[n] by matrix exponentiation .