摘要:
Coding a Dijkstra is not hard. %70 of my time spent on tackling TLE, as my last post.Dijkstra works in BFS manner, but at each step, it picks the shortest child greedily and then relax all other neighbors.Data Structure: since there could be up to 10000 cities, storing distance for all pairs of citi 阅读全文
摘要:
As a solo warrior in OJ, I spent about nearly 50% of my time on tackling TLE - that is innumerous hours. I almost lost my courage to OJ.But thanks to this post:http://www.spoj.com/forum/viewtopic.php?f=3&t=7968. I didn't use all of the hints, but getchar_unlocked works like charms.As advised 阅读全文