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算法,不会的点这里

最新文章

  1. 【C#附源码】数据库文档生成工具支持(Excel+Html)
  2. node中子进程同步输出
  3. erlang 故障排查工具
  4. Java的关键字与标识符
  5. Java多线程同步 synchronized 关键字的使用
  6. Modbus RTU程序开发解读
  7. 牛刀小试:使用Reactive Extensions(Rx),对短时间内多次发生的事件限流
  8. 【OpenGL】VS2010环境配置 [转]
  9. POJ 3261 Milk Patterns (求可重叠的k次最长重复子串)+后缀数组模板
  10. php pcntl 多进程学习
  11. 极域电子教室 e-Learning Class V4 2010专业版 学生机 卸载方法
  12. 使用Camstudio和KeyCastOW来录屏制作软件Demo视频
  13. 响应式、手机端、自适应 百分比实现div等宽等高的方法
  14. 用户信息文件/etc/passwd,影子文件/etc/shadow,组信息文件/etc/group,组密码文件/etc/gshadow,用户管理相关文件
  15. Redis配置信息
  16. Java货币金额转换为大写形式
  17. json格式字符串用Uncaught SyntaxError: Unexpected token &#39; Uncaught SyntaxError: Unexpected number
  18. python自动发送测试报告(五)
  19. hdu-6437-最大费用流
  20. centos下利用yum安装LAMP(Linux+Apache+MySQL+PHP)及配置

热门文章

  1. 【转】从头说catalan数及笔试面试里那些相关的问题
  2. long类型字段转换成varchar2类型
  3. Linux安全应用之防垃圾邮件server的构建
  4. [IT学习]Learn Python the Hard Way (Using Python 3)笨办法学Python3版本
  5. ASP.NET for WebApi
  6. Educational Codeforces Round 17 D. Maximum path DP
  7. Win7下安装iMac系统
  8. HDU - 2586 How far away ?(离线Tarjan算法)
  9. oracle分区表有什么作用
  10. ACGAN 论文笔记