시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 2859 785 511 28.062%

문제

요즘 많은 자동차에서는 GPS 네비게이션 장비가 설치되어 있다. 네비게이션은 사용자가 입력한 출발점과 도착점 사이의 최단 경로를 검색해 준다. 하지만, 교통 상황을 고려하지 않고 최단 경로를 검색하는 경우에는 극심한 교통 정체를 경험할 수 있다.

상근이는 오직 자기 자신만 사용 가능한 네비게이션을 만들고 있다. 이 네비게이션은 절대로 최단 경로를 찾아주지 않는다. 항상 거의 최단 경로를 찾아준다.

거의 최단 경로란 최단 경로에 포함되지 않는 도로로만 이루어진 경로 중 가장 짧은 것을 말한다. 

예를 들어, 도로 지도가 아래와 같을 때를 생각해보자. 원은 장소를 의미하고, 선은 단방향 도로를 나타낸다. 시작점은 S, 도착점은 D로 표시되어 있다. 굵은 선은 최단 경로를 나타낸다. (아래 그림에 최단 경로는 두 개가 있다)거의 최단 경로는 점선으로 표시된 경로이다. 이 경로는 최단 경로에 포함되지 않은 도로로 이루어진 경로 중 가장 짧은 경로이다. 거의 최단 경로는 여러 개 존재할 수도 있다. 예를 들어, 아래 그림의 길이가 3인 도로의 길이가 1이라면, 거의 최단 경로는 두 개가 된다. 또, 거의 최단 경로가 없는 경우도 있다.

입력

입력은 여러 개의 테스트 케이스로 이루어져 있다. 각 테스트 케이스의 첫째 줄에는 장소의 수 N (2 ≤ N ≤ 500)과 도로의 수 M (1 ≤ M ≤ 104)가 주어진다. 장소는 0부터 N-1번까지 번호가 매겨져 있다. 둘째 줄에는 시작점 S와 도착점 D가 주어진다. (S ≠ D; 0 ≤ S, D < N) 다음 M개 줄에는 도로의 정보 U, V, P가 주어진다. (U ≠ V ; 0 ≤ U, V < N; 1 ≤ P ≤ 103) 이 뜻은 U에서 V로 가는 도로의 길이가 P라는 뜻이다. U에서 V로 가는 도로는 최대 한 개이다. 또, U에서 V로 가는 도로와 V에서 U로 가는 도로는 다른 도로이다. 

입력의 마지막 줄에는 0이 두 개 주어진다.

출력

각 테스트 케이스에 대해서, 거의 최단 경로의 길이를 출력한다. 만약, 거의 최단 경로가 없는 경우에는 -1을 출력한다.

예제 입력 1

7 9
0 6
0 1 1
0 2 1
0 3 2
0 4 3
1 5 2
2 6 4
3 6 2
4 6 4
5 6 1
4 6
0 2
0 1 1
1 2 1
1 3 1
3 2 1
2 0 3
3 0 2
6 8
0 1
0 1 1
0 2 2
0 3 3
2 5 3
3 4 2
4 1 1
5 1 1
3 0 1
0 0

예제 출력 1

5
-1
6
W3sicHJvYmxlbV9pZCI6IjU3MTkiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWFjNzBcdWM3NTggXHVjZDVjXHViMmU4IFx1YWNiZFx1Yjg1YyIsImRlc2NyaXB0aW9uIjoiPHA+XHVjNjk0XHVjOTk4IFx1YjljZVx1Yzc0MCBcdWM3OTBcdWIzZDlcdWNjMjhcdWM1ZDBcdWMxMWNcdWIyOTQgR1BTIFx1YjEyNFx1YmU0NFx1YWM4Y1x1Yzc3NFx1YzE1OCBcdWM3YTVcdWJlNDRcdWFjMDAgXHVjMTI0XHVjZTU4XHViNDE4XHVjNWI0IFx1Yzc4OFx1YjJlNC4gXHViMTI0XHViZTQ0XHVhYzhjXHVjNzc0XHVjMTU4XHVjNzQwIFx1YzBhY1x1YzZhOVx1Yzc5MFx1YWMwMCBcdWM3ODVcdWI4MjVcdWQ1NWMgXHVjZDljXHViYzFjXHVjODEwXHVhY2ZjIFx1YjNjNFx1Y2MyOVx1YzgxMCBcdWMwYWNcdWM3NzRcdWM3NTggXHVjZDVjXHViMmU4IFx1YWNiZFx1Yjg1Y1x1Yjk3YyBcdWFjODBcdWMwYzlcdWQ1NzQgXHVjOTAwXHViMmU0LiBcdWQ1NThcdWM5YzBcdWI5Y2MsIFx1YWQ1MFx1ZDFiNSBcdWMwYzFcdWQ2NjlcdWM3NDQgXHVhY2UwXHViODI0XHVkNTU4XHVjOWMwIFx1YzU0YVx1YWNlMCBcdWNkNWNcdWIyZT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XQgbm90aWNlIHRoYXQgdGhlIGV4aXN0ZW5jZSBvZiBhIHJvdXRlIGZyb20gVSB0byBWIGRvZXMgbm90IGltcGx5IHRoZXJlIGlzIGEgcm91dGUgZnJvbSBWIHRvIFUsIGFuZCwgaWYgc3VjaCByb2FkIGV4aXN0cywgaXQgY2FuIGhhdmUgYSBkaVx1ZmIwMGVyZW50IGxlbmd0aC4gVGhlIGVuZCBvZiBpbnB1dCBpcyBpbmRpY2F0ZWQgYnkgYSBsaW5lIGNvbnRhaW5pbmcgb25seSB0d28gemVyb3Mgc2VwYXJhdGVkIGJ5IGEgc2luZ2xlIHNwYWNlLjxcL3A+XHJcbiIsIm91dHB1dCI6IjxwPkZvciBlYWNoIHRlc3QgY2FzZSBpbiB0aGUgaW5wdXQsIHlvdXIgcHJvZ3JhbSBtdXN0IHByaW50IGEgc2luZ2xlIGxpbmUsIGNvbnRhaW5pbmcgLTEgaWYgaXQgaXMgbm90IHBvc3NpYmxlIHRvIG1hdGNoIHRoZSByZXF1aXJlbWVudHMsIG9yIGFuIGludGVnZXIgcmVwcmVzZW50aW5nIHRoZSBsZW5ndGggb2YgdGhlIGFsbW9zdCBzaG9ydGVzdCBwYXRoIGZvdW5kLjxcL3A+XHJcbiIsImhpbnQiOiIiLCJvcmlnaW5hbCI6IjEiLCJwcm9ibGVtX2xhbmdfY29kZSI6Ilx1YzYwMVx1YzViNCJ9XQ==

출처

ACM-ICPC > Regionals > Latin America > South America Regional Contests 2008 A번

  • 문제를 번역한 사람: baekjoon
  • 데이터를 추가한 사람: gkswjdzz
  • 잘못된 데이터를 찾은 사람: tncks0121