最短路
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
给一个N个点M条边的连通无向图,满足每条边最多属于一个环,有Q组询问,每次询问两点之间的最短路径。
Input
输入的第一行包含三个整数,分别表示N和M和Q 下接M行,每行三个整数v,u,w表示一条无向边v-u,长度为w 最后Q行,每行两个整数v,u表示一组询问
Output
输出Q行,每行一个整数表示询问的答案
9 10 2
1 2 1
1 4 1
3 4 1
2 3 1
3 7 1
7 8 2
7 9 2
1 5 3
1 6 4
5 6 1
1 9
5 7
5
6
Hint
对于100%的数据,N<=10000,Q<=10000
20250324~25 圆方树
- Status
- Done
- Rule
- IOI
- Problem
- 5
- Start at
- 2025-3-18 14:00
- End at
- 2025-3-26 22:00
- Duration
- 200 hour(s)
- Host
- Partic.
- 8