Stealth

From programming_contest
Jump to navigation Jump to search

Just run dijkstra with the total probability of being detected along that path as the distance metric. Probabilities for each step are multiplied instead of added.

Add all possible Y starts when initializing the priority queue.