轉站通知

本站已停止更新!!想繼續收看我的新文章的話,請前往我的新Blog - Chino's

2014年2月23日 星期日

UVa::514 - Rails

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=455
stack的應用,先讓一節車廂進來,比對看看出去的誰第一個出去,如果就是stack的TOP就POP掉,重複POP到出去的不是TOP為止,再讓下一節車廂進來。

最後要是stack有剩下元素沒POP,這個組合就是no,反之yes。

沒有留言:

張貼留言