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:请教如何用差分约束来做

Posted by frankhuhu at 2007-09-03 22:28:07 on Problem 1201
In Reply To:请教如何用差分约束来做 Posted by:gffly at 2007-03-09 15:35:46
设S(i)为 1..i 中在最终序列中的的整数个数。

S(b) - S(a) >= c

0 <= S(i) - S(i-1) <= 1
---> 
     S(i) - S(i-1) >= 0
     S(i-1) - S(i) >= -1

得到了约束条件。bellman-ford搞掉。

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