文件名称:OptimalServices
- 所属分类:
- 其他小程序
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 229kb
- 下载次数:
- 0次
- 提 供 者:
- 张*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
acm算法设计
描述:
设有n 个顾客同时等待一项服务。顾客i需要的服务时间为ti ,1 < = i < = n 。应如何安排n个顾客的服务次序才能使平均等待时间达到最小?平均等待时间是n 个顾客等待服务时间的总和除以n。
对于给定的n个顾客需要的服务时间,编程计算最优服务次序。
输入:第一行是正整数n,表示有n 个顾客。接下来的1行中,有n个正整数,表示n个顾客需要的服务时间。
输出:最小平均等待时间
例输入:
10
56 12 1 99 1000 234 33 55 99 812
例输出:
532.00
-acm algorithm design Descr iption: n has a customer waiting for a service at the same time. I need to service customers time ti, 1 < = i < = n. N how to arrange the order of a customer' s service to make the average waiting time to a minimum? Average waiting time is n-time customers wait for service by dividing the sum of n. N for a given month of the service needs of customers, the best services to the order of the calculation program. Input: the first line is a positive integer n, that there are n customer. 1 the next line, there is a positive integer n, that n of the service needs of customers. Output: the minimum average waiting time for cases of type: 10 56 12 1 99 1000 234 33 55 99 812 cases Output: 532.00
描述:
设有n 个顾客同时等待一项服务。顾客i需要的服务时间为ti ,1 < = i < = n 。应如何安排n个顾客的服务次序才能使平均等待时间达到最小?平均等待时间是n 个顾客等待服务时间的总和除以n。
对于给定的n个顾客需要的服务时间,编程计算最优服务次序。
输入:第一行是正整数n,表示有n 个顾客。接下来的1行中,有n个正整数,表示n个顾客需要的服务时间。
输出:最小平均等待时间
例输入:
10
56 12 1 99 1000 234 33 55 99 812
例输出:
532.00
-acm algorithm design Descr iption: n has a customer waiting for a service at the same time. I need to service customers time ti, 1 < = i < = n. N how to arrange the order of a customer' s service to make the average waiting time to a minimum? Average waiting time is n-time customers wait for service by dividing the sum of n. N for a given month of the service needs of customers, the best services to the order of the calculation program. Input: the first line is a positive integer n, that there are n customer. 1 the next line, there is a positive integer n, that n of the service needs of customers. Output: the minimum average waiting time for cases of type: 10 56 12 1 99 1000 234 33 55 99 812 cases Output: 532.00
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Optimal Services
................\Debug
................\.....\Optimal Services.exe
................\.....\Optimal Services.ilk
................\.....\Optimal Services.obj
................\.....\Optimal Services.pch
................\.....\Optimal Services.pdb
................\.....\StdAfx.obj
................\.....\vc60.idb
................\.....\vc60.pdb
................\Optimal Services.cpp
................\Optimal Services.dsp
................\Optimal Services.dsw
................\Optimal Services.ncb
................\Optimal Services.opt
................\Optimal Services.plg
................\ReadMe.txt
................\StdAfx.cpp
................\StdAfx.h
................\Debug
................\.....\Optimal Services.exe
................\.....\Optimal Services.ilk
................\.....\Optimal Services.obj
................\.....\Optimal Services.pch
................\.....\Optimal Services.pdb
................\.....\StdAfx.obj
................\.....\vc60.idb
................\.....\vc60.pdb
................\Optimal Services.cpp
................\Optimal Services.dsp
................\Optimal Services.dsw
................\Optimal Services.ncb
................\Optimal Services.opt
................\Optimal Services.plg
................\ReadMe.txt
................\StdAfx.cpp
................\StdAfx.h