随笔分类 -  数学——分数规划

摘要:只能说我被一个小错搞得好心痛,本一写好代码感觉写的还优美,但一个小的不能再小的 i 写出u ,害的我正正调了一天。还不的不与别人对比看。OMG!!具体的分析找别人的吧,说的比我好,要吃个苹果放松下#include <cstdio>#include <cmath>#include <algorithm>#include <iostream>#include <queue>#define maxn 1005using namespace std;const int INF = 0x3f3f3f;double mid;struct Edge 阅读全文
posted @ 2013-05-23 18:07 等待最好的两个人 阅读(147) 评论(0) 推荐(0)
摘要:好蛋疼啊,由于double 不能用memset,害的我调了一个多小时才发现。由于用二分搜索,时间有点大#include #include #include #include #define maxn 1005using namespace std;const int INF = 0x3f3f3f;struct node{ int x,y,z;}Node[maxn];double d[maxn];double G[maxn][maxn];double cost[maxn][maxn];double benefit[maxn][maxn]; int n;double mid,ans;void c. 阅读全文
posted @ 2013-05-22 18:09 等待最好的两个人 阅读(171) 评论(0) 推荐(0)
摘要:#include#include#include#includeusing namespace std;const int maxn = 1005;struct node{ double a,b,c;}Node[maxn];//double a[maxn],b[maxn],c[maxn],d[maxn];int m,n,k;double mid;int cmp(const void *i,const void *j){ return (*(struct node *)i).c >n>>k && n){ m = n - k; for(int i=0;i... 阅读全文
posted @ 2013-05-20 19:05 等待最好的两个人 阅读(258) 评论(0) 推荐(0)
摘要:#include#include#include#includeusing namespace std;const int maxn = 1005;double a[maxn],b[maxn],c[maxn];int m,n,k;double L,R,mid;bool big(double p){ for(int i=0;in-1-m;i--) sum += c[i]; if(sum >= 0) return true; else return false;}int main(){ //if(freopen("input.txt","r",stdi 阅读全文
posted @ 2013-05-20 16:43 等待最好的两个人 阅读(206) 评论(0) 推荐(0)