Any Idea of how to solve this problem ?? https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=592&page=show_problem&problem=4768
# | User | Rating |
---|---|---|
1 | tourist | 3947 |
2 | jiangly | 3734 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3612 |
7 | ecnerwala | 3581 |
8 | Geothermal | 3569 |
8 | cnnfls_csy | 3569 |
10 | ksun48 | 3479 |
# | User | Contrib. |
---|---|---|
1 | awoo | 162 |
2 | maomao90 | 160 |
3 | nor | 156 |
4 | adamant | 155 |
4 | cry | 155 |
4 | atcoder_official | 155 |
4 | -is-this-fft- | 155 |
8 | maroonrk | 153 |
9 | SecondThread | 147 |
10 | Petr | 146 |
Any Idea of how to solve this problem ?? https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=592&page=show_problem&problem=4768
Name |
---|
Do YOU have any ideas about how to solve this problem? You should always write them when you ask a question (if you care about those who will spend time explaining you the solution).
BTW, the problem can be reduced to an ordinary Dijkstra's algorithm. This answer is as detailed as your question :).
well i tried to use Dijkstra but because the query number is very high it gave TLE
so it is clearly not useful to mention it, because it was week solution.
You're lazy to explain even how did you build the graph on which you ran Dijkstra, but still want to others to explain you the complete solution. It's an egoistic behaviour...
If your solution is correct, but too slow, it can be improved to get AC. And the process of step-by-step improvement will help you to develop your competitive programming skills (and not only them).
I don't mind to help you, but a teacher's job is not to give the learner the complete solution, but to point the learner to the correct direction. Thank you for your understanding.
Very nice problem indeed!
A little hint: Try to work with edges instead of nodes. That is, compute shortest path that ends in a certain edge instead of a certain node, and make an adjacency list for the edges instead of the nodes.