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^2)直接水啊,代码不到600B。

Posted by Ever_ljq at 2011-06-01 21:57:37 on Problem 2182
核心代码:
void work()
{
	for (int i = n; i >= 1; i--){
		ans[i] = num[i] + f[num[i]];
		for (int j = num[i]; j < i; j++)
			f[j] = f[j + 1] + 1;
	}
}
不过稍微有点慢,100+ms水过。

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