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

提供一个有意思的假解

Posted by kcaj1 at 2012-01-11 18:49:19 on Problem 3167
1.两两根据大小关系,把原数组和比对数组化成字串如"144321"变成">=<<<"

2.可知如果是匹配成功的部分,"大小关系串"也一定会匹配成功(反之不一定)

3.用这种方式找到答案以后,一一暴力验证(这样还是TLE)

4.加上safe优化:如果模式串只出现">="或"<="(非严格递增或递减),那么无须检查直接跳过

总结250MS通过

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