zoukankan      html  css  js  c++  java
  • poj3686 The Windy's(真没想到poj上的题目描述都这么迷)

    译文:
    问题描述
    岚是世界著名的玩具工厂,拥有M个一流的车间制造玩具。
    今年经理收到N个玩具的订单。经理知道每个订单在不同的车间需要不同的时间来制造。更准确地说,第i个订单在第j个车间制造,就需要Z[i][j]个小时。此外,每个订单必须完全在同一车间完成。车间不能中途换订单,必须先把手上的订单完成才行。订单的切换不需要任何时间。
    经理想要最小化完成N个任务的平均时间。
    你能帮助他吗?

    输入
    第一行是测试点的数量。每个测试点的第一行包含两个整数,N和M(1≤N M≤50)(M个车间,N个任务)。
    接下来的N行每个包含整数,描述矩阵Z[i]j每个测试点之前有一个空行。

    输出
    对于每一个测试点,输出单独一行表示答案
    答案保留六位小数。

    样例输入
    3

    3 4
    100 100 100 1
    99 99 99 1
    98 98 98 1

    3 4
    1 100 100 100
    99 1 99 99
    98 98 1 98

    3 4
    1 100 100 100
    1 99 99 99
    98 1 98 98

    样例输出
    2.000000
    1.000000
    1.333333

    原文:
    Description
    The Windy’s is a world famous toy factory that owns M top-class workshop to make toys. This year the manager receives N orders for toys. The manager knows that every order will take different amount of hours in different workshops. More precisely, the i-th order will take Zij hours if the toys are making in the j-th workshop. Moreover, each order’s work must be wholly completed in the same workshop. And a workshop can not switch to another order until it has finished the previous one. The switch does not cost any time.

    The manager wants to minimize the average of the finishing time of the N orders. Can you help him?

    Input
    The first line of input is the number of test case. The first line of each test case contains two integers, N and M (1 ≤ N,M ≤ 50).
    The next N lines each contain M integers, describing the matrix Zij (1 ≤ Zij ≤ 100,000) There is a blank line before each test case.

    Output
    For each test case output the answer on a single line. The result should be rounded to six decimal places.

    Sample Input
    3
    3 4
    100 100 100 1
    99 99 99 1
    98 98 98 1
    3 4
    1 100 100 100
    99 1 99 99
    98 98 1 98
    3 4
    1 100 100 100
    1 99 99 99
    98 1 98 98

    Sample Output
    2.000000
    1.000000
    1.333333

  • 相关阅读:
    WordPress 开源文章采集插件 胖鼠采集
    什么是Meta标签? 哪些Meta标签对搜索引擎SEO优化有作用?
    webpack简单原理及用法
    Vue工作原理小结
    angularjs工作原理解析
    雅虎工程师提供的CSS初始化示例代码
    移动端rem用法总结
    前端开发兼容问题大全
    GBDT原理详解
    代码实战之AdaBoost
  • 原文地址:https://www.cnblogs.com/wutongtong3117/p/7673112.html
Copyright © 2011-2022 走看看