当前位置: 首页 > news >正文

网站建设的步骤过程重庆建设信息

网站建设的步骤过程,重庆建设信息,网站做多个产品,完整的网站优化放啊我们的目标是使v/c最小化#xff0c;所以构造函数g(x)v-x*c#xff0c;那么 二分一个X#xff0c;判断当时的v-x*c的值是多少#xff0c;然后根据g(x)函数的 单调递减性来二分#xff0c;判断#xff0c;直到g(x)0的时候当前的X就是答案。 然后我直接写的tle了#xff0…我们的目标是使v/c最小化所以构造函数g(x)v-x*c那么 二分一个X判断当时的v-x*c的值是多少然后根据g(x)函数的 单调递减性来二分判断直到g(x)0的时候当前的X就是答案。 然后我直接写的tle了这是这两天tle的第3道题了。。。再改改。。。 /**************************************************************    Problem: 3232    User: BLADEVIL    Language: Pascal    Result: Time_Limit_Exceed****************************************************************/ //By BLADEVILconst    lim                         1e-5;     var    n, m                        :longint;    pre, other                  :array[0..100010] of longint;    len                         :array[0..100010] of extended;    last                        :array[0..3010] of longint;    tot                         :longint;    num                         :array[0..60,0..60] of longint;    key, heng, shu              :array[0..60,0..60] of longint;    sum                         :longint;    print                       :extended;    que, d                      :array[0..3010] of longint;    source, sink                :longint;     function min(a,b:extended):extended;begin    if ab then min:b else min:a;end; function judge(x:extended):extended;begin    if abs(x)lim then exit(0);    if x0 then exit(-1) else exit(1);end;     procedure connect(x,y:longint;z:extended);begin    inc(tot);    pre[tot]:last[x];    last[x]:tot;    other[tot]:y;    len[tot]:z;end;     procedure init;var    i, j                        :longint;     begin    read(n,m);    for i:1 to n do        for j:1 to m do num[i,j]:(i-1)*mj;    for i:1 to n do        for j:1 to m do        begin            read(key[i,j]);            sum:sumkey[i,j];        end;    for i:1 to n1 do        for j:1 to m do read(heng[i,j]);    for i:1 to n do        for j:1 to m1 do read(shu[i,j]);    source:num[n,m]2;    sink:source1;end; function bfs:boolean;var    q, p                        :longint;    h, t, cur                   :longint;begin    fillchar(d,sizeof(d),0);    d[source]:1;    h:0; t:1; que[1]:source;    while ht do    begin        inc(h);        cur:que[h];        q:last[cur];        while q0 do        begin            p:other[q];            if (judge(len[q])0) and (d[p]0) then            begin                inc(t);                que[t]:p;                d[p]:d[cur]1;                if psink then exit(true);            end;            q:pre[q];        end;    end;    exit(false);end; function dinic(x:longint;flow:extended):extended;var    rest, tmp                   :extended;    q, p                        :longint;     begin    if xsink then exit(flow);    rest:flow;    q:last[x];    while q0 do    begin        p:other[q];        if (judge(len[q])0) and (d[p]d[x]1) and (rest0) then        begin            tmp:dinic(p,min(rest,len[q]));            rest:rest-tmp;            len[q]:len[q]-tmp;            len[q xor 1]:len[q xor 1]tmp;        end;        q:pre[q];    end;    exit(flow-rest);end; procedure main;var    l, r, mid                   :extended;    cur                         :longint;    ans                         :extended;    i, j                        :longint;     begin    l:0; r:90;    while r-llim do    begin        mid:(lr)/2;        fillchar(last,sizeof(last),0);        tot:1;        for i:1 to n do            for j:1 to m do            begin                connect(source,num[i,j],key[i,j]);                connect(num[i,j],source,0);            end;                 for i:1 to n do            for j:1 to m do            begin                cur:0;                if i1 then inc(cur,heng[i,j]);                if in then inc(cur,heng[i1,j]);                if j1 then inc(cur,shu[i,j]);                if jm then inc(cur,shu[i,j1]);                if cur0 then                begin                    connect(num[i,j],sink,cur*mid);                    connect(sink,num[i,j],0);                end;            end;        for i:1 to n-1 do            for j:1 to m do            begin                connect(num[i,j],num[i1,j],heng[i1,j]*mid);                connect(num[i1,j],num[i,j],heng[i1,j]*mid);            end;        for i:1 to n do            for j:1 to m-1 do            begin                connect(num[i,j],num[i,j1],shu[i,j1]*mid);                connect(num[i,j1],num[i,j],shu[i,j1]*mid);            end;        ans:0;        while bfs do            ans:ansdinic(source,maxlongint);        if judge(sum-ans)0 then l:mid else r:mid;    end;    writeln(l:0:3);end; begin    init;    main;end. 转载于:https://www.cnblogs.com/BLADEVIL/p/3500432.html
http://www.pierceye.com/news/799537/

相关文章:

  • 企业营销网站建设的基本步骤吉林省建设工程质量监督站网站
  • 现在用什么软件做网站北京工程设计公司排名
  • 烟台网站开发技术找人做网站服务器不是自己的怎么办
  • 网站样式下载pc网站建设的优势是什么
  • 网站是怎么建设的网页制作基础教程第2版葛艳玲答案
  • 企业做一个网站的费用网站设计专业需要什么
  • 昆山住房和城乡建设部网站网站开发用的工具
  • 广州优化网站建设网站建设是怎么赚钱
  • 公司建设网站公司系统软件开发培训机构
  • 小程序分销系统开发成熟的网站怎么做seo推广
  • 网站dns修改wordpress极简清新主题
  • 南京网站建设价位招商门户网站建设方案
  • 中学加强校园网站建设个人博客网站开发的原因
  • 网站域名管理中心广州市外贸网站建设企业
  • wordpress建站位置布吉网站建设价格
  • 网站域名正在维护中企业内网网站建设
  • 广西南宁官方网站企业wordpress和ueeshop
  • access数据库做网站自贸区注册公司有什么优势
  • 福州做网站公司企信网企业信用信息系统黑龙江
  • 网站建设先学什么保定徐水网站建设
  • 济南网站建设哪个好电商创业
  • 如何在年报网站上做遗失公告天津做企业网站公司
  • 嘉兴网站关键词排名网页制作与设计课程设计报告
  • 室内装饰网站模板网络营销的策略
  • 如何做网站充值58百度搜索引擎
  • 专门做衣服的网站有哪些广告公司名字怎么取
  • 亚马逊如何做折扣网站的营销在线3d建模网站
  • 深圳市seo网站设计dz做的网站容易收录吗
  • 西安手机网站wordpress 绑定两个域名
  • 郑州定制网站推广工具平面设计接私活一般多少钱