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

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

?? 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国产精品久久久久久久久久| 国产肉丝袜一区二区| 欧美成人乱码一区二区三区| 欧美激情一区三区| 日本午夜精品一区二区三区电影| 国产大陆精品国产| 51精品久久久久久久蜜臀| √…a在线天堂一区| 久久成人18免费观看| 欧美日韩精品一区二区天天拍小说| 国产精品视频第一区| 蜜臀av一区二区三区| 欧美三级电影精品| 亚洲男同1069视频| 成人av在线电影| 精品第一国产综合精品aⅴ| 亚洲成人午夜电影| 91福利小视频| 亚洲另类一区二区| 91在线精品一区二区三区| 国产色产综合产在线视频| 久久精品二区亚洲w码| 在线成人免费观看| 亚洲国产成人av| 欧美伊人久久久久久午夜久久久久| 国产精品福利一区二区三区| 成人看片黄a免费看在线| 久久精品在线观看| 粉嫩久久99精品久久久久久夜 | 国内精品第一页| 欧美日韩第一区日日骚| 午夜电影一区二区三区| 欧美日韩精品电影| 日本不卡一二三| 91精品国产日韩91久久久久久| 亚洲最大成人网4388xx| 欧美午夜一区二区三区| 日韩国产欧美在线视频| 日韩欧美一二区| 国产精选一区二区三区| 国产精品美女久久久久av爽李琼| 成人激情午夜影院| 亚洲精品视频免费看| 欧美肥大bbwbbw高潮| 六月丁香综合在线视频| 久久精品人人做| 成人精品一区二区三区中文字幕| 亚洲欧美综合色| 欧美性猛交xxxxxx富婆| 免费在线观看一区| 国产色产综合色产在线视频| 91首页免费视频| 三级一区在线视频先锋 | 久久不见久久见中文字幕免费| 欧美成人精品二区三区99精品| 国产一区二区三区国产| 亚洲色图欧美在线| 欧美欧美欧美欧美首页| 国产一区二区在线电影| 亚洲免费观看高清完整版在线| 欧美日韩三级在线| 国产成人丝袜美腿| 亚洲成a人在线观看| 国产午夜精品一区二区三区嫩草 | 亚洲在线中文字幕| 精品国产乱码久久久久久久久 | 日韩视频免费直播| 国产精品1024久久| 亚洲成人精品一区二区| 久久人人超碰精品| 欧美午夜不卡在线观看免费| 精久久久久久久久久久| 亚洲精品国产一区二区精华液| 91精品国产入口| 91丨porny丨国产入口| 久久成人免费网站| 亚洲五码中文字幕| 久久久精品免费免费| 欧美日韩国产综合一区二区三区 | 六月丁香婷婷色狠狠久久| 综合在线观看色| 精品国产sm最大网站免费看| 91在线观看美女| 国产一区美女在线| 午夜视频在线观看一区二区| 国产精品灌醉下药二区| 欧美tickling挠脚心丨vk| 在线免费观看一区| 成人激情开心网| 激情综合亚洲精品| 日本v片在线高清不卡在线观看| 亚洲视频免费观看| 中文久久乱码一区二区| 久久亚洲一区二区三区明星换脸| 欧美日韩国产色站一区二区三区| 99精品视频中文字幕| 国产精品综合一区二区| 六月丁香综合在线视频| 日韩中文字幕1| 亚洲成人第一页| 亚洲国产日产av| 亚洲精品免费看| 亚洲人吸女人奶水| 国产精品高潮呻吟久久| 国产精品久久综合| 欧美国产日本韩| 国产欧美精品一区二区色综合朱莉 | 精品国产第一区二区三区观看体验| 欧美丰满少妇xxxbbb| 在线观看日韩电影| 欧美性猛交xxxxxxxx| 色老汉一区二区三区| 色综合久久天天| 欧美亚洲自拍偷拍| 欧美色国产精品| 欧美精品久久天天躁| 67194成人在线观看| 欧美精品久久一区二区三区| 日韩手机在线导航| 欧美va亚洲va国产综合| 久久精品日产第一区二区三区高清版 | 国产精品福利一区| 亚洲美女视频在线观看| 一区二区日韩av| 午夜精品福利一区二区蜜股av| 天天综合网天天综合色| 男人的j进女人的j一区| 久久电影网站中文字幕| 国产精品99久久久久久久女警| 国产一区二区三区av电影| 成人久久18免费网站麻豆| 在线视频你懂得一区| 3atv一区二区三区| 精品国产乱码久久久久久闺蜜| 欧美激情中文不卡| 亚洲一区二区三区四区不卡 | 国产精品国模大尺度视频| 亚洲一级片在线观看| 免费在线看成人av| 成人午夜又粗又硬又大| 欧美三级三级三级| 精品国产乱码久久久久久免费| 亚洲欧洲韩国日本视频| 亚洲成人第一页| 国产成人精品亚洲午夜麻豆| 欧美在线视频你懂得| 久久久久久久综合日本| 亚洲欧洲综合另类在线| 蜜桃在线一区二区三区| 99精品视频一区二区三区| 欧美日韩综合不卡| 久久精品人人做人人综合| 亚洲伊人色欲综合网| 国内精品久久久久影院薰衣草| 一本色道久久综合亚洲91| 欧美电视剧免费全集观看| 亚洲男人的天堂一区二区| 国产一区二区三区四区五区美女| 色综合av在线| 国产日韩欧美电影| 视频在线观看一区二区三区| 成人高清免费在线播放| 日韩一二三四区| 夜夜爽夜夜爽精品视频| 福利一区二区在线| 日韩午夜在线影院| 亚洲综合色网站| 成人黄色免费短视频| 日韩美女视频在线| 午夜电影网亚洲视频| 99久久综合国产精品| 久久综合中文字幕| 青青草国产成人99久久| 欧美这里有精品| 亚洲三级理论片| 丁香婷婷综合色啪| 精品卡一卡二卡三卡四在线| 日韩av不卡在线观看| 欧美三级在线看| 亚洲精品亚洲人成人网在线播放| 国产白丝精品91爽爽久久| 精品日韩在线观看| 免费在线成人网| 欧美一区二区三区在线视频| 亚洲成a人片综合在线| 欧美在线综合视频| 一级精品视频在线观看宜春院 | 欧美不卡一区二区三区四区| 日韩激情视频网站| 欧美日韩精品欧美日韩精品| 一区二区三区精品在线观看| 91免费观看视频| 国产精品第五页| 97久久久精品综合88久久| 国产精品理论片| 99视频国产精品| 自拍偷拍亚洲综合| 色屁屁一区二区| 亚洲成在线观看| 欧美肥妇bbw|