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

Re:一个小数据,可能会hack掉一部分代码

Posted by ray_bb at 2018-04-04 14:05:09 on Problem 1743
In Reply To:Re:一个小数据,可能会hack掉一部分代码 Posted by:965087276 at 2017-04-24 18:26:35
因为对原序列做了差分之后,差分序列中两个相邻的元素对应回原来序列恰好有一个元素的重叠。
举个例子:
序列1 2 3 4 5 6 7 8 9
做差分后:1 1 1 1 1 1 1 1
用>=mid做出的最长不重叠子串会是1 1 1 1,但是两个1 1 1 1对应到原来的序列分别是1 2 3 4 5和5 6 7 8 9。有一个5是重叠的。
所以两个子串中间还要隔一个元素,所以正确的是>mid。

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