某石油公司计划建造一条由东向西的主输油管道。该管道要穿过一个有 n 口油井的油田。从每口油井都要有一条输油管道沿最短路经(或南或北)与主管道相连。如果给定 n口油井的位置,即它们的 x 坐标(东西向)和 y 坐标(南北向),应如何确定主管道的最优位置,即使各油井到主管道之间的输油管道长度总和最小的位置?证明可在线性时间内确定主管道的最优位置,使得给定n口油井的位置,编程计算各油井到主管道之间的输油管道最小长度总和。
SHOW FULL COLUMNS FROM `jrk_downrecords` [ RunTime:0.001861s ]
SELECT `a`.`aid`,`a`.`title`,`a`.`create_time`,`m`.`username` FROM `jrk_downrecords` `a` INNER JOIN `jrk_member` `m` ON `a`.`uid`=`m`.`id` WHERE `a`.`status` = 1 GROUP BY `a`.`aid` ORDER BY `a`.`create_time` DESC LIMIT 10 [ RunTime:0.101931s ]
SHOW FULL COLUMNS FROM `jrk_tagrecords` [ RunTime:0.001622s ]
SELECT * FROM `jrk_tagrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 20 [ RunTime:0.002044s ]
SHOW FULL COLUMNS FROM `jrk_member` [ RunTime:0.001699s ]
SELECT `id`,`username`,`userhead`,`usertime` FROM `jrk_member` WHERE `status` = 1 ORDER BY `usertime` DESC LIMIT 10 [ RunTime:0.005474s ]
SHOW FULL COLUMNS FROM `jrk_searchrecords` [ RunTime:0.001630s ]
SELECT * FROM `jrk_searchrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 5 [ RunTime:0.007177s ]
SELECT aid,title,count(aid) as c FROM `jrk_downrecords` GROUP BY `aid` ORDER BY `c` DESC LIMIT 10 [ RunTime:0.020448s ]
SHOW FULL COLUMNS FROM `jrk_articles` [ RunTime:0.001141s ]
UPDATE `jrk_articles` SET `hits` = 2 WHERE `id` = 377331 [ RunTime:0.014511s ]