亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? basicu.pas

?? 運(yùn)籌學(xué)演示程序之運(yùn)輸問(wèn)題
?? PAS
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
Unit BasicU;

interface
uses
  Windows,Messages,SysUtils,Classes,Controls,Forms,Grids,Dialogs;
Type
  matrix=array of array of real;

procedure pause(t:Dword);
procedure xbj_init(pc,sc:byte;produce,sale:array of real;var amount:matrix);
procedure xbj_d_init(pc,sc:byte;produce,sale:array of real;
              var amount:matrix;var grid:Tstringgrid;ptime:dword);
procedure zdfy_init(pc,sc:byte;produce,sale:array of real;
                                 cost:matrix;var amount:matrix);
procedure zdfy_d_init(pc,sc:byte;produce,sale:array of real;
              cost:matrix;var amount:matrix;
              var grid1:Tstringgrid;var grid2:tstringgrid;
              ptime:dword);
procedure ce_init(pc,sc:byte;produce,sale:array of real;
                                 cost:matrix;var amount:matrix);
procedure ce_d_init(pc,sc:byte;produce,sale:array of real;
              cost:matrix;var amount:matrix;
              var grid1:Tstringgrid;var grid2:Tstringgrid;
              ptime:dword);

implementation

PROCEDURE pause(t:Dword);
var i:dword;
begin
  i:=gettickcount;
  while((i+t)>=gettickcount) do ;
end;

PROCEDURE ce_d_init(pc,sc:byte;produce,sale:array of real;
              cost:matrix;var amount:matrix;
              var grid1:Tstringgrid;var grid2:Tstringgrid;ptime:dword);
var i,j:byte;
    da:real;
    min_i,min_j:byte;
    spare_p,spare_s:real;
    ban_p,ban_s:array of real;
    done:matrix;
  function find_min:boolean;
  var i,j:integer;get_one:boolean;
      po,po2:byte;pb:boolean;
      zui,zuixiao:real;
  begin
    get_one:=false;
    pb:=true;
    da:=-1;
    po:=0;po2:=0;
    for i:=0 to pc-1 do
    begin
      if (ban_p[i]>da) then
      begin
        da:=ban_p[i];
        po:=i; pb:=true;
        get_one:=true;
      end;
    end;
    for j:=0 to sc-1 do
    begin
      if (ban_s[j]>da) then
      begin
        da:=ban_s[j];
        po:=j; pb:=false;
        get_one:=true;
      end;
    end;
    if (get_one) then
    begin
      if (pb) then
      begin
        min_i:=po;
        zui:=-1;
        for i:=0 to sc-1 do
          if (done[po,i]>=0) then
            zui:=cost[po,i];
        if (zui=-1) then get_one:=false
        else begin
          zuixiao:=zui;
          for i:=0 to sc-1 do
            if ((done[po,i]>=0)and(cost[po,i]<=zuixiao)) then
            begin
              po2:=i;
              zuixiao:=cost[po,i];
            end;
          min_j:=po2;
        end;
      end else begin
        min_j:=po;
        zui:=-1;
        for j:=0 to pc-1 do
          if (done[j,po]>=0) then
            zui:=cost[j,po];
        if (zui=-1) then get_one:=false
        else begin
          zuixiao:=zui;
          for j:=0 to pc-1 do
            if ((done[j,po]>=0)and(cost[j,po]<=zuixiao)) then
            begin
              po2:=j;
              zuixiao:=cost[j,po];
            end;
          min_i:=po2;
        end;
      end;
    end;
    result:=get_one;
  end;
  procedure unenable_s(x,y:byte); //橫
  var i:integer;
  begin
    for i:=0 to pc-1 do done[i,y]:=-1;
  end;
  procedure unenable_p(x,y:byte);
  var i:integer;
  begin
    for i:=0 to sc-1 do done[x,i]:=-1;
  end;
  procedure check_spare_s(var s_s:real;y:byte);
  var m:real;i:integer;
  begin
    m:=sale[y];
    for i:=0 to pc-1 do
      if done[i,y]<0 then m:=m-amount[i,y];
    s_s:=m;
  end;
  procedure check_spare_p(var s_p:real;x:byte);
  var m:real;i:integer;
  begin
    m:=produce[x];
    for i:=0 to sc-1 do
      if done[x,i]<0 then m:=m-amount[x,i];
    s_p:=m;
  end;
  function all_done:boolean;
  var i,j:integer; done1,done2:boolean;
      count:real;
  begin
    done1:=true;
    for i:=0 to pc-1 do for j:=0 to sc-1 do
      if (done[i,j]>=0) then done1:=false;
    if (not done1) then
    begin
      done2:=true;
      for i:=0 to pc-1 do
      begin
        count:=0;
        for j:=0 to sc-1 do count:=count+amount[i,j];
        if (count<>produce[i]) then done2:=false;
        if (not done2) then
        begin
          result:=done2;
          exit;
        end;
      end;
      for i:=0 to sc-1 do
      begin
        count:=0;
        for j:=0 to pc-1 do count:=count+amount[i,j];
        if (count<>sale[i]) then done2:=false;
        if (not done2) then
        begin
          result:=done2;
          exit;
        end;
      end;
      result:=done2;
    end
    else result:=done1;
  end;
  procedure reset_ban;
  var v,w,u:byte;
      zuixiao,cixiao:real;
      findcixiao:boolean;
  begin
    u:=0;
    for v:=0 to sc-1 do
    begin
      if (ban_s[v]>=0) then
      begin
        zuixiao:=maxint;
        for w:=0 to pc-1 do
          if ((done[w,v]>=0)and(cost[w,v]<zuixiao)) then
          begin
            u:=w;
            zuixiao:=cost[w,v];
          end;
        cixiao:=maxint;
        findcixiao:=false;
        for w:=0 to pc-1 do
          if ((done[w,v]>=0)and(cost[w,v]<cixiao)) then
          begin
            if (w<>u) then begin
              cixiao:=cost[w,v]; findcixiao:=true;
            end;
          end;
        if (findcixiao) then
          ban_s[v]:=cixiao-zuixiao
        else ban_s[v]:=0;
      end;
    end;
    for v:=0 to pc-1 do
    begin
      if (ban_p[v]>=0) then
      begin
        zuixiao:=maxint;
        for w:=0 to sc-1 do
          if ((done[v,w]>=0)and(cost[v,w]<zuixiao)) then
          begin
            u:=w;
            zuixiao:=cost[v,w];
          end;
        cixiao:=maxint;
        findcixiao:=false;
        for w:=0 to sc-1 do
          if ((done[v,w]>=0)and(cost[v,w]<cixiao)) then
          begin
            if (w<>u) then begin
              cixiao:=cost[v,w]; findcixiao:=true;
            end;
          end;
        if (findcixiao) then
          ban_p[v]:=cixiao-zuixiao
        else ban_p[v]:=0;
      end;
    end;
  end;
  procedure do_end;
  var w,v,u:byte;
      another:boolean;
  begin
    for w:=0 to pc-1 do
      for v:=0 to sc-1 do
        if (done[w,v]=0) then
        begin
          another:=false;
          for u:=0 to sc-1 do
            if ((u<>v)and(done[w,u]=0)) then another:=true;
          if (another) then
            check_spare_s(amount[w,v],v)
          else
            check_spare_p(amount[w,v],w);
        end;
  end;
BEGIN
  da:=-1;
  setlength(done,pc,sc);
  setlength(ban_p,pc);
  setlength(ban_s,sc);
  for i:=0 to pc-1 do ban_p[i]:=maxint;
  for i:=0 to sc-1 do ban_s[i]:=maxint;
  for i:=0 to pc-1 do for j:=0 to sc-1 do
  begin
      done[i,j]:=0;
      amount[i,j]:=0;
  end;
  min_i:=0;min_j:=0;
  grid1.cells[0,0]:='列\(zhòng)行差';
  grid2.cells[0,0]:='產(chǎn)\銷量';
  for i:=1 to pc do
    for j:=1 to sc do
      grid1.cells[j,i]:=floattostr(cost[i-1,j-1]);
  grid1.Refresh;
  for i:=1 to pc do
    grid2.cells[0,i]:=floattostr(produce[i-1]);
  for j:=1 to sc do
    grid2.cells[j,0]:=floattostr(sale[j-1]);
  grid2.refresh;
  reset_ban;
  repeat
    if (not find_min) then break;
    check_spare_s(spare_s,min_j);
    check_spare_p(spare_p,min_i);
    if (spare_p<spare_s) then
    begin
      amount[min_i,min_j]:=spare_p;
      unenable_p(min_i,min_j);
    end
    else if (spare_s<spare_p) then
    begin
      amount[min_i,min_j]:=spare_s;
      unenable_s(min_i,min_j);
    end
    else begin
      amount[min_i,min_j]:=spare_p;
      unenable_s(min_i,min_j);
      unenable_p(min_i,min_j);
    end;
    reset_ban;
    for i:=1 to pc do
      for j:=1 to sc do
      begin
        if (done[i-1,j-1]=-1) then
        begin
          grid1.cells[j,i]:='--';
          if (amount[i-1,j-1]>0) then
            grid2.cells[j,i]:=floattostr(amount[i-1,j-1])
          else
            grid2.cells[j,i]:='--';
        end
        else
        begin
          grid1.cells[j,i]:=floattostr(cost[i-1,j-1]);
        end;
      end;
    for i:=1 to pc do
      grid1.cells[0,i]:=floattostr(ban_p[i-1]);
    for j:=1 to sc do
      grid1.cells[j,0]:=floattostr(ban_s[j-1]);
    grid1.refresh;
    grid2.refresh;
    pause(ptime);
  until all_done;
  do_end;
  for i:=1 to pc do
    for j:=1 to sc do
      begin
        if (done[i-1,j-1]=-1) then
        begin
          if (amount[i-1,j-1]>0) then
            grid2.cells[j,i]:=floattostr(amount[i-1,j-1])
          else
            grid2.cells[j,i]:='--';
        end
        else
          if (amount[i-1,j-1]>0) then
            grid2.cells[j,i]:=floattostr(amount[i-1,j-1]);
      end;
  grid2.refresh;
END;

PROCEDURE ce_init(pc,sc:byte;produce,sale:array of real;
        cost:matrix;var amount:matrix);
var i,j:byte;
    da:real;
    min_i,min_j:byte;
    spare_p,spare_s:real;
    ban_p,ban_s:array of real;
    done:matrix;
  function find_min:boolean;
  var i,j:integer;get_one:boolean;
      po,po2:byte;pb:boolean;
      zui,zuixiao:real;
  begin
    get_one:=false;
    pb:=true;
    da:=-1;
    po:=0;po2:=0;
    for i:=0 to pc-1 do
    begin
      if (ban_p[i]>da) then
      begin
        da:=ban_p[i];
        po:=i; pb:=true;
        get_one:=true;
      end;
    end;
    for j:=0 to sc-1 do
    begin
      if (ban_s[j]>da) then
      begin
        da:=ban_s[j];
        po:=j; pb:=false;
        get_one:=true;
      end;
    end;
    if (get_one) then
    begin
      if (pb) then
      begin
        min_i:=po;
        zui:=-1;
        for i:=0 to sc-1 do
          if (done[po,i]>=0) then
            zui:=cost[po,i];
        if (zui=-1) then get_one:=false
        else begin
          zuixiao:=zui;
          for i:=0 to sc-1 do
            if ((done[po,i]>=0)and(cost[po,i]<=zuixiao)) then
            begin
              po2:=i;
              zuixiao:=cost[po,i];
            end;
          min_j:=po2;
        end;
      end else begin
        min_j:=po;
        zui:=-1;
        for j:=0 to pc-1 do
          if (done[j,po]>=0) then
            zui:=cost[j,po];
        if (zui=-1) then get_one:=false
        else begin
          zuixiao:=zui;
          for j:=0 to pc-1 do
            if ((done[j,po]>=0)and(cost[j,po]<=zuixiao)) then
            begin
              po2:=j;
              zuixiao:=cost[j,po];
            end;
          min_i:=po2;
        end;
      end;
    end;
    result:=get_one;
  end;
  procedure unenable_s(x,y:byte); //橫
  var i:integer;
  begin
    for i:=0 to pc-1 do done[i,y]:=-1;
  end;
  procedure unenable_p(x,y:byte);
  var i:integer;
  begin
    for i:=0 to sc-1 do done[x,i]:=-1;
  end;
  procedure check_spare_s(var s_s:real;y:byte);
  var m:real;i:integer;
  begin
    m:=sale[y];
    for i:=0 to pc-1 do
      if done[i,y]<0 then m:=m-amount[i,y];
    s_s:=m;
  end;
  procedure check_spare_p(var s_p:real;x:byte);
  var m:real;i:integer;
  begin
    m:=produce[x];
    for i:=0 to sc-1 do
      if done[x,i]<0 then m:=m-amount[x,i];
    s_p:=m;
  end;
  function all_done:boolean;
  var i,j:integer; done1,done2:boolean;
      count:real;
  begin
    done1:=true;
    for i:=0 to pc-1 do for j:=0 to sc-1 do
      if (done[i,j]>=0) then done1:=false;
    if (not done1) then
    begin
      done2:=true;
      for i:=0 to pc-1 do
      begin
        count:=0;
        for j:=0 to sc-1 do count:=count+amount[i,j];
        if (count<>produce[i]) then done2:=false;
        if (not done2) then
        begin
          result:=done2;
          exit;
        end;
      end;
      for i:=0 to sc-1 do
      begin
        count:=0;
        for j:=0 to pc-1 do count:=count+amount[i,j];
        if (count<>sale[i]) then done2:=false;
        if (not done2) then
        begin
          result:=done2;
          exit;
        end;
      end;
      result:=done2;
    end
    else result:=done1;
  end;
  procedure reset_ban;
  var v,w,u:byte;
      zuixiao,cixiao:real;
      findcixiao:boolean;
  begin
    u:=0;
    for v:=0 to sc-1 do
    begin
      if (ban_s[v]>=0) then
      begin
        zuixiao:=maxint;
        for w:=0 to pc-1 do
          if ((done[w,v]>=0)and(cost[w,v]<zuixiao)) then
          begin
            u:=w;
            zuixiao:=cost[w,v];
          end;
        cixiao:=maxint;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀99久久精品久久久久久软件| 欧美日韩一区小说| 欧美精品一区二区三区蜜臀| 免费成人深夜小野草| 91精品国产综合久久香蕉麻豆| 视频一区欧美精品| 欧美日韩成人一区| 日韩毛片高清在线播放| 99麻豆久久久国产精品免费| 国产日产欧美一区二区视频| 国产91精品久久久久久久网曝门| 精品福利视频一区二区三区| 国产成人h网站| 国产精品拍天天在线| 91丨porny丨国产| 亚洲精品美腿丝袜| 成人午夜伦理影院| 亚洲激情图片小说视频| 色婷婷亚洲综合| 日韩精品亚洲一区二区三区免费| 欧美日韩国产一级片| 精品一区二区三区影院在线午夜| 久久综合久久综合久久综合| 成人免费毛片aaaaa**| 亚洲成人激情综合网| 日韩精品一区二区三区中文精品| 国产成人精品影视| 亚洲激情图片qvod| 51精品视频一区二区三区| 国产久卡久卡久卡久卡视频精品| 国产午夜精品一区二区三区视频| 日韩午夜在线播放| 黑人精品欧美一区二区蜜桃| 欧美剧情片在线观看| 日韩一区二区在线看| 青草国产精品久久久久久| 日韩不卡手机在线v区| 成熟亚洲日本毛茸茸凸凹| 成人avav影音| 国产欧美日韩视频在线观看| 国产精品国产自产拍在线| 精品电影一区二区| 日本不卡1234视频| www.欧美日韩国产在线| 亚洲午夜久久久久久久久久久| 91精品国产综合久久精品| 久久91精品国产91久久小草| 国产精品美女一区二区| 欧美日韩一区二区在线观看视频| 风间由美性色一区二区三区| 亚洲综合色区另类av| 69久久99精品久久久久婷婷 | 捆绑调教一区二区三区| 欧美激情在线一区二区三区| 538在线一区二区精品国产| 国产suv精品一区二区三区 | 最新国产精品久久精品| 538prom精品视频线放| 国产乱码精品一区二区三| 日韩精品一级中文字幕精品视频免费观看| 久久综合国产精品| 51久久夜色精品国产麻豆| 成人视屏免费看| 青青草国产成人av片免费| 亚洲资源在线观看| 久久日韩精品一区二区五区| 欧美一级片免费看| 91国偷自产一区二区开放时间| av不卡在线观看| 国产精品99久久久久| 视频一区国产视频| 亚洲午夜电影网| 中文字幕一区二区三区四区不卡 | 国产乱妇无码大片在线观看| 亚洲成a人v欧美综合天堂| 精品国产一二三| 2020国产精品久久精品美国| 在线播放亚洲一区| 欧洲一区二区三区免费视频| 成人avav在线| 成人久久久精品乱码一区二区三区 | 麻豆91精品91久久久的内涵| 亚洲一区二区三区免费视频| 欧美激情综合五月色丁香小说| 国产精品你懂的在线欣赏| 精品国产免费一区二区三区香蕉| 久久综合成人精品亚洲另类欧美 | 亚洲欧洲精品天堂一级| 国产日韩欧美不卡在线| 日韩免费视频线观看| 制服.丝袜.亚洲.中文.综合| 欧美一卡二卡三卡| 欧美一区二区免费视频| 色乱码一区二区三区88| av资源网一区| 99久久精品久久久久久清纯| 91久久精品一区二区三| 色婷婷国产精品| 欧美日韩精品欧美日韩精品一| 欧美日韩免费观看一区二区三区| 欧美无人高清视频在线观看| 91精品国产欧美日韩| 欧美α欧美αv大片| 国产精品婷婷午夜在线观看| 国产精品久久久久久久久免费桃花| 日韩视频123| 国产精品丝袜久久久久久app| 中文字幕二三区不卡| 亚洲午夜私人影院| 免费成人av在线播放| 青青草国产成人99久久| 成人伦理片在线| 欧洲视频一区二区| 精品久久久三级丝袜| 中文字幕欧美国产| 国产精品伦理在线| 亚洲一二三四在线| 亚洲va欧美va人人爽| 国产成人免费在线| 91老师片黄在线观看| 精品国产91久久久久久久妲己| 久久久激情视频| 一区二区三区欧美| 久久国产乱子精品免费女| 高清在线成人网| 这里只有精品视频在线观看| 2023国产精品视频| 亚洲第一av色| 国产福利一区二区| 99re成人在线| 日韩欧美激情四射| 中文字幕在线不卡| 亚洲线精品一区二区三区| 久久不见久久见中文字幕免费| 久久国产精品99精品国产| 97精品电影院| 精品嫩草影院久久| 欧美激情一区在线| 亚洲伊人色欲综合网| 国产一区二区视频在线| 国产高清不卡一区二区| 制服丝袜日韩国产| 综合激情网...| 岛国精品一区二区| 日韩欧美国产不卡| 亚洲成人在线观看视频| 成人激情小说乱人伦| 久久久久久99久久久精品网站| 亚洲一二三四久久| 91麻豆福利精品推荐| 久久久一区二区| 亚洲国产cao| 在线观看亚洲成人| 久久综合九色综合97_久久久| 免费精品视频在线| 欧美视频你懂的| 亚洲乱码国产乱码精品精98午夜| 国内成人精品2018免费看| 欧美亚洲日本一区| 亚洲一区二区三区精品在线| 成人性生交大合| 亚洲国产精品黑人久久久| 免费亚洲电影在线| 欧美乱熟臀69xxxxxx| 国产精品嫩草影院com| 国产综合久久久久久鬼色| 91精品在线观看入口| 亚洲激情图片qvod| 欧美色大人视频| 亚洲欧洲精品一区二区精品久久久| 成人精品免费看| 国产网站一区二区| 成人黄色小视频在线观看| 久久蜜桃av一区精品变态类天堂| 亚洲电影在线免费观看| 欧美亚洲自拍偷拍| 国产精品久久久久天堂| 91视频www| 中文字幕亚洲成人| 色婷婷av一区| 一区二区三区欧美日韩| 欧美日韩黄视频| 午夜视频在线观看一区二区三区| 成人晚上爱看视频| 亚洲素人一区二区| 不卡的av在线播放| 亚洲欧美自拍偷拍| 国产iv一区二区三区| 欧美国产精品专区| 精品亚洲欧美一区| 中文字幕日韩一区| 91免费国产在线| 日本少妇一区二区| 精品电影一区二区| 97se狠狠狠综合亚洲狠狠| 亚洲色图制服丝袜| 91麻豆精品国产自产在线观看一区| 美女视频黄a大片欧美| 日本一区二区电影| 色综合天天在线|