Introduction
It is a hard level algorithm. What I did is to learn as many ideas as possible. One thing I did is to read weekly contest 128 top 50 players and their code to solve this hard problem.
Top 50 players
Here is the link.
I will write down a few ideas based on top 50 players and the solutions written by them.
Ranking No. 13
VladaMG98It is so challenging for me to work on hard level algorithm in the weekly contest. What I can do is to study top 195 players and quickly go over all the solutions.
I have to push myself to learn how to write a solution, as simple as possible. Sometimes it is hard for me to write a dynamic programming solution, and there are so many ideas to write one. I just could not belived that I could not come out one simple idea.
I wrote a depth first search solution with backtracking based on rankng No. 13's code. Here is C# code, right now there is an time limit exceeded issue.
Follow up
March 21, 2019
Here is the solution I wrote which passes online judge.
No comments:
Post a Comment