| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 8 | 6 | 6 | 75.000% |
Ann works for a shipping company in the wild frontier. Her job is simple; she must deliver a package to the West before a certain deadline. You are to determine when Ann will reach her destination and whether or not Ann is late.
You will be given a top-down map of the area Ann must traverse and the number of days until the deadline that Ann must deliver the package by. It will take Ann 3 days to cross a normal area of land, 5 days to cross a wooded area, and 8 days to cross a body of water. Ann cannot cross over rocks because it will break her wagon. Her goal is to get to the West, which is simply the far left column on the map. She can travel in any of the four directions: north, east, south, and west (no diagonals). On some maps it may be impossible for Ann to reach the West.
Note: The far left column will contain only . (periods) and is not included in the overall time.
The first line of input will contain a single integer n that indicates the number of data sets to follow. Each data set will consist of:
You are to output the result of Ann’s trip. If Ann is able to get to the West by the deadline print “The Package arrived with d day(s) to spare.” where d is the number of days still left until the original deadline. If Ann cannot deliver the package in time, simply print “The Package was not delivered in time.”
2 7 7 ..W.... ..W.... ..W.... ..W..FF ..W.R.. ..W..R. .....RS 35 5 10 ....RF.... ....RF.... ...R.FF..S ..R..FF... ...R.FF... 50
The Package arrived with 4 day(s) to spare. The Package was not delivered in time.
School > PLU High School Programming Contest > PLU 2019 > Advanced 12번