Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

找了个AC的程序和我的动态规划程序对拍了近百组随机数据,全部AC,我的神啊!!到底有什么变态数据啊!

Posted by DE_SEAN at 2011-03-31 11:23:57 on Problem 3617
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator