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

参考大牛的思想瞬间秒杀

Posted by uestc254136 at 2009-07-31 18:59:04 on Problem 1065
吃饭碰到nill, 问了个关于组合数学的问题。
结果他直接说就是求最长不上升子序列。 还告诉我自己贪心的思路是错的
回来贴上子序列的模板,瞬间秒杀。。。。 囧啊, 囧啊
没a的兄弟们注意
7
9 48 29 2 26 42 9 35 4 25 45 16 26 21
前面有个人给过数据
正确结果是 3
注意关键字排序。 
bool comp1(const struct node a, const struct node b)
{
	if(a.x == b.x)	return a.y < b.y;
	else return a.x < b.x;
}
bool comp2(const struct node a,const struct node b)
{
	if(a.y == b.y)	return a.x < b.x;
	else
	return a.y< b.y;
}

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