-
内存仿真算法
模拟内存工作方式的算法-way memory simulation algorithm
- 2022-02-04 19:23:21下载
- 积分:1
-
算法实现题2
算法实现题2-1 输油管道问题
« 问题描述:
某石油公司计划建造一条由东向西的主输油管道。该管道要穿过一个有n 口油井的油
田。从每口油井都要有一条输油管道沿最短路经(或南或北)与主管道相连。如果给定n口油
井的位置,即它们的x 坐标(东西向)和y 坐标(南北向),应如何确定主管道的最优位置,
即使各油井到主管道之间的输油管道长度总和最小的位置?证明可在线性时间内确定主管道
的最优位置。
« 编程任务:
给定n 口油井的位置,编程计算各油井到主管道之间的输油管道最小长度总和。
« 数据输入:
由文件input.txt 提供输入数据。文件的第1 行是油井数n,1£ n£ 10000。接下来n 行是
油井的位置,每行2个整数x和y,-10000£ x,y£ 10000。
« 结果输出:
程序运行结束时,将计算结果输出到文件output.txt 中。文件的第1 行中的数是油井到
主管道之间的输油管道最小长度总和。
输入文件示例 输出文件示例
input.txt output.txt
5
1 2
2 2
1 3
3 -2
3 3
6
- 2022-11-12 20:40:04下载
- 积分:1
-
主要用于复数类的计算,功能齐全,经过检验
主要用于复数类的计算,功能齐全,经过检验-Mainly used in the plural type of calculation, functional and tested
- 2023-06-17 13:15:04下载
- 积分:1
-
This is a source code written in Visual Basic to Eject/ Inject the CD ROM tray!
This is a source code written in Visual Basic to Eject/ Inject the CD ROM tray!
- 2022-02-15 20:03:43下载
- 积分:1
-
数字黑洞程序. 你输入一个不超过10的整数,然后按倍数从大到小排列,减去位数从小到大排列的数字.得出的数重复做上面的操作,最后会吸进一个数字....
数字黑洞程序. 你输入一个不超过10的整数,然后按倍数从大到小排列,减去位数从小到大排列的数字.得出的数重复做上面的操作,最后会吸进一个数字.-digital black hole procedures. You enter a not exceed 10 Integer, and then arranged by multiples on average, less median from small to large with the figures. Come do a few repeat the above operation will eventually sucked into a figure.
- 2022-11-11 10:40:04下载
- 积分:1
-
From a small program, VC++ written, DisplayMode used to obtain the various param...
上传个小程序,VC++写的,DisplayMode用于获取当前显示器的各种参数-From a small program, VC++ written, DisplayMode used to obtain the various parameters of the current display
- 2022-03-18 01:03:49下载
- 积分:1
-
串口调试助手V2.3的VC++源代码,欢迎下载
串口调试助手V2.3的VC++源代码,欢迎下载-Serial Debugging Assistant V2.3 of the VC++ source code, please download the
- 2022-01-30 14:27:18下载
- 积分:1
-
windows main class function 实例3
windows main class function 实例3-windows main class function Example 3
- 2022-09-07 12:25:02下载
- 积分:1
-
用ATL写的IE插件
用ATL写的IE插件-ATL was used IE plug-in
- 2022-01-26 03:19:14下载
- 积分:1
-
Encryption and decryption use PC1 algorithm
Encryption and decryption use PC1 algorithm
- 2022-03-16 04:31:14下载
- 积分:1