| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 21 | 4 | 4 | 40.000% |
Since his cows have been well-behaved, Farmer John sends them on vacation during the winter to visit with USACO head coach Rob K. Since Rob lives in Colorado, he loves to take the cows out snow skiing and needs your help to determine the best ski location to visit. Specifically, since he doesn't want the cows to get bored, he wants to visit a mountain on which there are many routes to ski from top to bottom.
You will be given a file which contains a description of a mountain and its interesting landmarks. The file describes landmarks, their elevation, and which paths exist between various landmarks.
The landmarks with the largest and smallest elevations represent respectively the top and bottom of the mountain. All ski routes must start at the top of the mountain and follow some sequence of ski paths, moving from landmark to landmark downhill, until they reach the bottom of the mountain.
Your task is to compute the number of different possible ski routes.
A single integer on the output line that specifies the total possible number of paths down the mountain.
4 5 500 400 300 200 1 2 2 3 3 4 1 4 2 4
3