摘要: Fence RepairTime Limit:2000MSMemory Limit:65536KTotal Submissions:21209Accepted:6762DescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needsN(1 ≤N≤ 20,000) planks of wood, each having some integer lengthLi(1 ≤Li≤ 50,000) uni 阅读全文
posted @ 2013-11-18 22:08 偶尔会寂寞 阅读(313) 评论(0) 推荐(0) 编辑
摘要: //区间调度/*问题描述:有N项工作,每项工作有开始时间si和结束时间ti,让你选择最多的工作,工作之间不存在时间交叉。输入:51 32 54 76 98 10输出:3*/#include#includeusing namespace std;const int MAX = 100000;int N, s[MAX], t[MAX];//输入,s开始时间,t结束时间pair itv[MAX];//用于对工作排序的pair数组int main(){ cin>>N; int i; for(i=0;i>itv[i].second>>itv[i].first;//便于以结束 阅读全文
posted @ 2013-11-18 20:38 偶尔会寂寞 阅读(1261) 评论(0) 推荐(2) 编辑