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

果然dp要注意相等的情况

Posted by popotiger at 2013-06-22 10:29:52 on Problem 1609
compare函数要加入相等的判断
struct Box {
	int wid;
	int len;
	Box(int x, int y) : wid(x), len(y) {}

	bool operator< (const Box &b) const { 
		if(wid == b.wid) return len < b.len;
		else return wid < b.wid; 
	}
		//return wid < b.wid; }
};

否则的话
4
1 2
1 4
1 3
1 5
这个case就会错

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