시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 1 | 1 | 1 | 100.000% |
After the banquet tonight, you will leave the banquet venue together with the F new friends you have made and walk back to your hotel. You want to keep chatting with them as long as possible, though you may unfortunately not all be in the same hotel.
Everybody, you included, is taking one of the shortest paths back to their hotel.
Paris is made of N intersections numbered from 0 to N − 1 and S streets linking two intersections. Streets can of course be walked in both directions. All hotels are located at intersections and are reachable from the banquet. The banquet takes place at intersection number 0.
The input comprises several lines, each consisting of integers separated with single spaces:
The output should consist of a single line, whose content is an integer, the longest time (in minutes) you can stay accompanied by at least one friend.
7 12 1 0 1 1 0 2 2 0 2 4 1 3 2 2 3 1 1 4 2 4 2 2 1 5 3 2 5 1 5 6 2 4 6 2 3 6 3 3 6
2
ICPC > Regionals > Europe > Southwestern European Regional Contest > SWERC 2018 PA번