Description
You were just hired as CEO of the local junkyard.One of your jobs is dealing with the incoming trash and sorting it for recycling.The trash comes every day in n containers and each of these containers contains certain amount of each of the n types of trash.Given the amount of trash in the containers find the optimal way to sort the trash.Sorting the trash means putting every type of trash in separate container.Each of the given containers has infinite capacity.The effort for moving one unit of trash from container i to j is 1 if i != j otherwise it is 0.You are to minimize the total effort.
你受聘于当地的垃圾处理公司任CEO,你的一项工作是处理引进的垃圾,以及分类垃圾以进行循环利用。每天,垃圾会有几个集装箱运来,每一个集装箱都包含几种垃圾。给定集装箱里垃圾的数目,请找出最佳的途径去分类这些垃圾。分类垃圾即把每种垃圾分开装到不同的集装箱中。每个集装箱的容量都是无限的。搬动一个单位的垃圾需要耗费代价,从集装箱i到j是1(i<>j,否则代价为0),你必须把代价减到最小。

Input
The first line contains the number n (1 <= n <= 150), the rest of the input file contains the descriptions of the containers.The 1 + i-th line contains the desctiption of the i-th container the j-th amount (0 <= amount <= 100) on this line denotes the amount of the j-th type of trash in the i-th container.
第一行为n(1<=n<=150),以下为集装箱的情况。第i+1行为第i个集装箱中的j种垃圾的数量amount(0<=amount<=100)。

Output
You should write the minimal effort that is required for sorting the trash.
分类这些垃圾的所需的最小代价。

Sample Input
4
62 41 86 94
73 58 11 12
69 93 89 88
81 40 69 13

Sample Output
650


二分图带权匹配,KM算法,不会的点这里

ural1076 Trash 垃圾的更多相关文章

  1. 越狱Season 1-Episode 10: Sleight of Hand

    Season 1, Episode 10: Sleight of Hand -John: Bellick. Bellick What's going on? 这里发生什么了 -Berwick: Tha ...

  2. 越狱Season 1-Episode 7: Riots, Drills and the Devil: Part 2

    Season 1, Episode 7: Riots, Drills and the Devil: Part 2 -Pope: Belick, get those guys in line guy: ...

  3. ceph mimic版本 部署安装

    ceph 寻址过程 1. file --- object映射, 把file分割成N个相同的对象 2. object - PG 映射, 利用静态hash得到objectID的伪随机值,在 "位 ...

  4. query_posts函数使用方法小结|wordpress技巧

    query_posts是wordpress非常好用的调用文章函数,可以调用某个分类.标签.日期及作者等不同范围的文章列表.下面随ytkah一起来看看query_posts函数使用方法小结 首先是que ...

  5. Hadoop(3)如何构建HDFS--HA,YARN---HA

    什么是HA? HA的意思是High Availability高可用,指当当前工作中的机器宕机后,会自动处理这个异常,并将工作无缝地转移到其他备用机器上去,以来保证服务的高可用. HA方式安装部署才是最 ...

  6. 用python制作训练集和测试集的图片名列表文本

    # -*- coding: utf-8 -*- from pathlib import Path #从pathlib中导入Path import os import fileinput import ...

  7. URAL 1076 Trash Trash(最大权匹配)

    Trash Time limit: 1.0 secondMemory limit: 64 MB You were just hired as CEO of the local junkyard.One ...

  8. AS3垃圾回收整理

    AS3垃圾回收整理 转自 http://bbs.wefdc.com/thread-2366-1-1.html 来源页面: http://www.adobe.com/devnet/actionscrip ...

  9. P1156 垃圾陷阱 DP

    题目描述 卡门――农夫约翰极其珍视的一条Holsteins奶牛――已经落了到“垃圾井”中.“垃圾井”是农夫们扔垃圾的地方,它的深度为D(2 \le D \le 100)D(2≤D≤100)英尺. 卡门 ...

随机推荐

  1. Xpath—解决这个问题的良药

    何为良药? 因为在XML中存在一些问题和缺陷,针对这些问题就产生了响应的解决方式.如: getElementById方法在解析XML时因为一些原因适不适合的: 首先XML中每一个元素节点不一定有id属 ...

  2. 微信小程序实战之 goods(订餐页)

    项目目录: 模拟数据: utils / data.js function getSData() { var data = [ { "name": "热销榜", ...

  3. C#使用SharpZipLib压缩解压文件

    #region 加压解压方法 /// <summary> /// 功能:压缩文件(暂时只压缩文件夹下一级目录中的文件,文件夹及其子级被忽略) /// </summary> // ...

  4. 爬取指定网页的源代码显示在GUI中

    建立一个GUI图形界面用来用来输入网址和代码显示的区域 #encoding=utf-8 __author__ = 'heng' #创建一个可以抓取输入网址源代码的GUI from urllib2 im ...

  5. Python的调用程序

    任务 调用系统命令ping 判断局域网内有哪些主机存活 假设你用c语言写了一个算法,需要对该算法进行测试.测试的数据集几百个.这时可以使用过GCC生成test.exe,再使用python批量调用该ex ...

  6. thinkphp3.2.3 数据库写入add 方法的一些问题。

    最近在做项目中遇到的一个数据操作add()方法,在不开启debug的模式下会漏掉一些字段没写入数据库. 当时并不知道是这个原因,明明在开发的时候都是没问题的,怎么突然出现这个问题,找了好久都没有头绪, ...

  7. Oracle可插拔数据库的jdbc连接串写法

    我在服务器上部署某个第三方系统的数据库的时候,服务器数据库版本为oracle 12c.我采用的方式是新建了一个实例.访问正常. 后来项目的负责人告诉我,oracle12C支持所谓的可插拔数据库.可插拔 ...

  8. 微信企业号调用js-sdk注意事项

    企业号应用必须添加可信域名,域名必须通过备案,可以是子域名,如果网站带端口,一定也要加上端口号...踩坑记

  9. js常用操作事件

    触发描述 方法 用法 点击 onclick="method();"   变换 onchange="testChange();"   双击 ondblclick= ...

  10. bzoj4594: [Shoi2015]零件组装机

    论静态查错的重要性...乱搞题真难调 首先这题看起来就是要分治检验了. 考虑对于区间[l,r],分成[l,p-1]和[p,r]使得这两个区间合并可以得到[l,r],并且要保证后面一个区间较大 设前一个 ...