当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3196:Let’s Ship

题目描述
  Nineright is manager of a shipping company. With only ONE ship at the beginning of his career, he had to carefully consider the trip to maximize his incoming. But unlike other vehicles, shipping costs much more time.
  One day, Nineright comes to you for your help. He is so excited, and said:” help me! I have found the best way to do the business. I would consider the route as a circle that my ship could run every minute! What’s more, I find the route with the maximum average profit is the best. Now, I am going to get them together…”
  What a nice idea! You’re going to help him, don’t you!
  You are going to get the map as a directed graph. And from city i to city j, you would earn some money pij by do the business. It will cost you tij time to finish that. You are going to find the circle route with maximum average profit!
输入解释
There are no more than 20 cases. Process to the end of file
Each case begin with N (3 <= N <= 100) represents the number of the city.
Following are N line each with N numbers. The j-th number of the i-th rows stands for the profit you will get if you ship from city i to cit j. with the same format the next N*N number give the time to finish that trip. pij would be a integer that lies between -1000 and 10000 and The profit pij doesn’t have to be same with pji, because cities have different demands. This is also holds for tij and tji maybe because the weather. tij would also be an integer lies between 1 and 1000. The i-th number in the i-th row would always be 0;
输出解释
Output the average of the profit each in one line,and the result should accurate within 0.1.
输入样例
3
0 59 19
56 0 52
88 26 0
0 7 4
1 0 3
7 6 0
输出样例
14.4
来自杭电HDUOJ的附加信息
Author ZSTU
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3196

最后修改于 2020-10-25T23:01:05+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000/3000MS(Java/Others) 32768/32768K(Java/Others)