2013年10月31日
摘要: 问题描述:有n个部队,第i个部队布置任务时间为Bi,执行任务时间为Ji算法:布置任务时间总和为固定值,再加上执行任务所需时间的最小值即可 1 #include 2 #include 3 using namespace std; 4 5 int const MAXN=10000; 6 int B[MAXN],J[MAXN]; 7 int main() 8 { 9 int n;10 cin >>n; //输入部下数目11 for(int i=0; i>B[i] >>J[i]; /... 阅读全文
posted @ 2013-10-31 23:34 缠绕寂寞 阅读(412) 评论(0) 推荐(0)
摘要: n条龙直径为x,m个勇士,能量值为x能砍直径 2 #include 3 using namespace std; 4 5 const int MAXM=2000; 6 int B[MAXM], A[MAXM]; 7 int main() 8 { 9 int n,m;10 // cout >n >>m;12 // cout >A[i];14 // cout >B[j];16 sort(A,A+n);17 sort(B,B+m);18 int cost=0; //当前总费用19 int ... 阅读全文
posted @ 2013-10-31 22:35 缠绕寂寞 阅读(162) 评论(0) 推荐(0)
  2013年10月20日
摘要: #include using namespace std;struct Node{ int data; Node * next;};class LinkList{public: Node *Head; void CreatList(int length); void Display();};void LinkList::CreatList(int length) //尾插法创建链表{ Node *p, *q; p=Head; cout >q->data; q->next=p->next; p->next=q; ... 阅读全文
posted @ 2013-10-20 20:30 缠绕寂寞 阅读(279) 评论(0) 推荐(0)