ural1076 Trash 垃圾
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 垃圾的更多相关文章
- 越狱Season 1-Episode 10: Sleight of Hand
Season 1, Episode 10: Sleight of Hand -John: Bellick. Bellick What's going on? 这里发生什么了 -Berwick: Tha ...
- 越狱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: ...
- ceph mimic版本 部署安装
ceph 寻址过程 1. file --- object映射, 把file分割成N个相同的对象 2. object - PG 映射, 利用静态hash得到objectID的伪随机值,在 "位 ...
- query_posts函数使用方法小结|wordpress技巧
query_posts是wordpress非常好用的调用文章函数,可以调用某个分类.标签.日期及作者等不同范围的文章列表.下面随ytkah一起来看看query_posts函数使用方法小结 首先是que ...
- Hadoop(3)如何构建HDFS--HA,YARN---HA
什么是HA? HA的意思是High Availability高可用,指当当前工作中的机器宕机后,会自动处理这个异常,并将工作无缝地转移到其他备用机器上去,以来保证服务的高可用. HA方式安装部署才是最 ...
- 用python制作训练集和测试集的图片名列表文本
# -*- coding: utf-8 -*- from pathlib import Path #从pathlib中导入Path import os import fileinput import ...
- URAL 1076 Trash Trash(最大权匹配)
Trash Time limit: 1.0 secondMemory limit: 64 MB You were just hired as CEO of the local junkyard.One ...
- AS3垃圾回收整理
AS3垃圾回收整理 转自 http://bbs.wefdc.com/thread-2366-1-1.html 来源页面: http://www.adobe.com/devnet/actionscrip ...
- P1156 垃圾陷阱 DP
题目描述 卡门――农夫约翰极其珍视的一条Holsteins奶牛――已经落了到“垃圾井”中.“垃圾井”是农夫们扔垃圾的地方,它的深度为D(2 \le D \le 100)D(2≤D≤100)英尺. 卡门 ...
随机推荐
- firedac数据集的序列和还原
procedure TForm1.Button1Click(Sender: TObject);var stream, stream2: TMemoryStream; buf: TBytes;begin ...
- cds.data:=dsp.data赋值有时会出现AV错误剖析
cds.data:=dsp.data赋值有时会出现AV错误剖析 如果QUERY没有查询到任何数据,cds.data:=dsp.data赋值会触发AV错误. 大家知道,DATASNAP有许多远程方法就是 ...
- 进程(WINAPI),遍历并查找树状的进程信息,实现控制系统进程
#include <TlHelp32.h> //检索系统全部进程 void showall() { PROCESSENTRY32 pe32 = {0}; pe32.dwSize = siz ...
- linux 查找目录下的文件内容并替换(批量)
2.sed和grep配合 命令:sed -i s/yyyy/xxxx/g `grep yyyy -rl --include="*.txt" ./` 作用:将当前目录(包括子目录)中 ...
- linux 下shell脚本执行多个命令的方法
1.每个命令之间用;隔开说明:各命令的执行给果,不会影响其它命令的执行.换句话说,各个命令都会执行,但不保证每个命令都执行成功. 2.每个命令之间用&&隔开说明:若前面的命令执行成功, ...
- long类型字段转换成varchar2类型
參考文档: How to Convert a Long to Varchar2 (文档 ID 228532.1) /*long类型字段转换成varchar2类型*/ --建表 create table ...
- Failed to load resource: the server responded with a status of 404 (Not Found)
Failed to load resource: the server responded with a status of 404 (Not Found) 报错情况:图标加载失败 原因分析:路径错误 ...
- DB 查询分析器 6.03 ,遨游于不论什么Windows操作系统之上的最棒的数据库client工具
DB 查询分析器 6.03 ,遨游于不论什么Windows操作系统之上的最棒的数据库client工具 中国本土程序猿马根峰(CSDN专訪马根峰:海量数据处理与分析大师的中国本土程序猿 .03版本 ...
- 基于空间直方图meanshift跟踪
近期看了一篇文章<spatiograms versus histograms for region-based tracking>,在此把这篇文章的核心思想及算法推理进行整理. 空间直方图 ...
- 【Java集合源代码剖析】HashMap源代码剖析
转载请注明出处:http://blog.csdn.net/ns_code/article/details/36034955 您好,我正在參加CSDN博文大赛,假设您喜欢我的文章.希望您能帮我投一票.谢 ...