hdu 1022 Train Problem I (栈)

Yes.inininoutoutoutFINISHNo.FINISH

Hint

Hint

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.".

,一个今天胜过两个明天

hdu 1022 Train Problem I (栈)

相关文章:

你感兴趣的文章:

标签云: