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

O(N^3)的枚举

Posted by smallBrain at 2010-07-02 10:24:21 on Problem 1018
O(N^2)枚举所有可能的B,每次枚举用O(N)计算P。
为了可以在O(N)复杂度内计算P定义一个getp[a][b]表示第a行第b个B的最小P值。
计算getp数组复杂度为O(N^3)
我的计算方法比较弱,对所有可能的B排序,求出每个B的序号,第a行的序号为L1……Lm(a)
[0,L1]填充P1,(L1,L2]填充P2,以此类推。

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