You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi ,
I''m working on the mentioned challenge, and I see you made a CPP version.
With an algorithm of dynamic programming i reach good results, when L and R become LONG type, then it take forever to calculate even only one.
So i wonder if you had the same issue and how you tackled it/
Giuseppe
The text was updated successfully, but these errors were encountered:
Yes, DP will only get you about 30% points. Complexity of the basic DP algorithm is O(N_R) which in the worst case is 10^18. I didn't solve it but this was the hardest problem on the week of code competition. I think the idea was to use DP for smaller cases, that is for all F(m) where m<N_a1_a2_...*aN. For bigger m you had to use Lagrange interpolation somehow. If you want I can check the solution and write it here.
From the mathematical perspective I also was thinking about some sort of
integration between the two points but I thought was too far and the
category of the exercise is DP.
I didn't try the Lagrange interpolation to define the F(x), thank for the
hint, will have a look and let you know the results.
Yes, DP will only get you about 30% points. Complexity of the basic DP
algorithm is O(N_R) which in the worst case is 10^18. I didn't solve it
but this was the hardest problem on the week of code competition. I think
the idea was to use DP for smaller cases, that is for all F(m) where m<N_
a1_a2_...*aN. For bigger m you had to use Lagrange interpolation somehow.
If you want I can check the solution and write it here.
Hi ,
I''m working on the mentioned challenge, and I see you made a CPP version.
With an algorithm of dynamic programming i reach good results, when L and R become LONG type, then it take forever to calculate even only one.
So i wonder if you had the same issue and how you tackled it/
Giuseppe
The text was updated successfully, but these errors were encountered: