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

将N^4改进为N^3*logN算法.

Posted by intheway at 2009-11-17 21:08:53 on Problem 1018
对每行的B值小到大排序, N^2 dp求出f[i][j], 表示i行j~num[i]的最大P值.
N^2枚举B值 * N枚举每行 * logN二分查找大于等于当前B的位置,即f[i][x].
嫌麻烦的话用lower_bound就OK了.

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