PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#FW0000026. Tránh gặp sếp (Avoiding Your Boss)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Tránh gặp sếp (Avoiding Your Boss)
Avoiding Your Boss
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
In an undirected weighted road graph, a boss travels from home to office via any shortest route. Avoid every vertex belonging to any boss-shortest route (including endpoints), then find the shortest cost from to .
Input
followed by weighted undirected roads.
Output
Print the shortest cost or exactly MISSION IMPOSSIBLE..
Subtasks
- Subtask 1 (40 points): ; ; ; ; .
- Subtask 2 (60 points): ; ; ; .
Examples
Input
3 2 1 3 2 1
1 2 4
2 3 4
Output
MISSION IMPOSSIBLE.
Explanation
Every vertex belongs to the boss’s shortest path. The employee begins at a forbidden vertex , so the mission is impossible.