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 |
找了个AC的程序和我的动态规划程序对拍了近百组随机数据,全部AC,我的神啊!!到底有什么变态数据啊!In Reply To:这题用动态规划TLE可以理解,怎么会WA呢?~~无奈 Posted by:DE_SEAN at 2011-03-30 16:42:51 最后很不情愿的用了那个用贪心写的程序~但我很奇怪, for(;s[i]==s[j]&&i<=j;){ i++;j--; } if(s[i]<=s[j]) return 0; else return 1; 为什么s[i]==s[j]后,可以直接把范围缩小到(i+1,j-1), 而不是 (i+1,j) 和 (i,j-1)呢? 请懂的人指教一下 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator