Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:这题是不是有直接算ROOT值然后COMPARE的方法啊?In Reply To:这题是不是有直接算ROOT值然后COMPARE的方法啊? Posted by:11119999 at 2009-01-10 13:54:54 我的代码90行,主要是根据输入串建树,然后对树DFS,重新获得一个排序后的01串。 对两个输入串分别运用上述方法分别得到两个排序后的01串,如果两个串相等则same,否则different 关键在于DFS时对子树返回的01串进行存储和排序,然后重组 比如对于0100101100100111和0011000111010101,重组后分别变成: 0001101100101101和0001110011010101,不相等所以输出different 可以去看看我的代码:http://blog.csdn.net/bobten2008/archive/2009/11/07/4781994.aspx Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator