3 123 321 3 123 312
Yes. in in in out out out FINISH No. FINISH For the first Sample Input, we let train 1 get in, then train 2 and train 3. So now train 3 is at the top of the railway, so train 3 can leave first, then train 2 and train 1. In the second Sample input, we should let train 3 leave first, so we have to let train 1 get in, then train 2 and train 3. Now we can let train 3 leave. But after that we can't let train 1 leave before train 2, because train 2 is at the top of the railway at the moment. So we output "No.".
Author | Ignatius.L |
Recommend |
时间上限 | 内存上限 |
2000/1000MS(Java/Others) | 65536/32768K(Java/Others) |
·
·
·
·