随笔分类 -  数学——轮换不等式

摘要:由于是背包问题,但直接用dp, 不满足dp中的无后效性,所以用排序来改变顺序;#include <cstdio>#include <cmath>#include <algorithm>#include <iostream>#include <queue>#include <cstdlib>#include <cstring>#define maxn 3005using namespace std;const int INF = 0x3f3f3f;int dp[10005];int ans = 0;struct 阅读全文
posted @ 2013-05-25 10:17 等待最好的两个人 阅读(175) 评论(0) 推荐(0)
摘要:#include<iostream>#include<cstring>#include<cstdio>#include<algorithm>#include<cstdlib>using namespace std;const int maxn = 100010;int n;struct node{ int w,s;}floor[maxn];int cmp(node a,node b){ return a.w-b.s < b.w - a.s; }int main(){ //if(freopen("input.txt&qu 阅读全文
posted @ 2013-05-23 21:19 等待最好的两个人 阅读(163) 评论(0) 推荐(0)
摘要:轮换不等式性质: 1.可比性.2.传递性 1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 #include<cstdlib> 5 #include<algorithm> 6 using namespace std; 7 8 const int maxn = 10005; 9 struct emeny{10 int hp,apk;11 double ave;12 int time;1... 阅读全文
posted @ 2013-05-23 19:17 等待最好的两个人 阅读(190) 评论(0) 推荐(0)