摘要: #include<iostream>#include<algorithm>using namespace std;struct Meet{ int beg; int end; int num;}meet[1000]; class setMeet{public: void init(); void s 阅读全文
posted @ 2018-03-19 15:40 神韵袖藏 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 问题描述:一个有限时间中尽可能多的开很多会议。每个会议有开始时间和结束时间。设计出一种算法,得出在已知的各个会议中选出会议,使在这段时间中开的会议最多。 数据结构:结构体: struct Meet{ int number; int begin; int end;}; 代码: #include<ios 阅读全文
posted @ 2018-03-19 15:07 神韵袖藏 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 使用贪心算法: #include <iostream>#include<algorithm>using namespace std; //宝物的数据结构struct Treature{ double cost; double weigth; double costproferce;};bool cm 阅读全文
posted @ 2018-03-19 14:03 神韵袖藏 阅读(186) 评论(0) 推荐(0) 编辑