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. 【SDCC讲师专访】PingCAP联合创始人兼CEO刘奇:好的产品应开源,不闭门造车-CSDN.NET

    [SDCC讲师专访]PingCAP联合创始人兼CEO刘奇:好的产品应开源,不闭门造车-CSDN.NET 小米的Themis

  2. 【c++】C++中const用法总结

    1.      const常量,如const int max = 100; 优点:const常量有数据类型,而宏常量没有数据类型.编译器可以对前者进行类型安全检查,而对后者只进行字符替换,没有类型安全 ...

  3. Linux系统启动流程分析

    作者:郭孝星 微博:郭孝星的新浪微博 邮箱:allenwells@163.com 博客:http://blog.csdn.net/allenwells Github:https://github.co ...

  4. Visual Studio VS如何重置所有设置

    工具-导入和导出设置-重置所有设置,点击下一步即可.                  

  5. DosBox 报错 this program requires dosxnt.exe to be in your path

    也就是少了dosxnt.exe文件,能够上网搜索下载,把dosxnt 拷贝到你挂截文件夹下就能够执行 Dosxnt文件下载

  6. 【Sublime】Sublime Text 2集成TortoiseSVN插件

    作者:zhanhailiang 日期:2014-09-30 1. 下载TortoiseSVN.将其安装在默认位置: 2. 使用Sublime包管理器下载安装TortoiseSVN Plugin,安装后 ...

  7. Qt 用户登录界面

     使用QT创建自己的登录窗口: 主要步骤:    1.窗口界面的绘制     2.沟通数据库进行密码验证 void MainWindow::on_pushButton_clicked() { // 连 ...

  8. sparse-PCA(稀疏主成分分析)是什么?

    不多说,直接上干货! 复杂降维技术有spare-PCA和sparse coding. 最近在科研需要,感谢下面的博主. Sparse PCA 稀疏主成分分析

  9. 【CTF】后续深入学习内容

    1.i春秋 https://www.ichunqiu.com/course/451 搜索black hat,可以看到黑帽大会的内容.免费. 2.wireshark 基础篇 1)由于Wireshark是 ...

  10. Form content types

    Forms in HTML documents https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4 17.13.4 Form con ...