POJ 1015题意
来源:互联网 发布:电脑绘制工程图纸软件 编辑:程序博客网 时间:2024/05/18 02:39
In Frobnia, a far-away country, the verdicts in court trials are determined by a jury consisting of members of the general public. Every time a trial is set to begin, a jury has to be selected, which is done as follows. First, several people are drawn randomly from the public. For each person in this pool, defence and prosecution assign a grade from 0 to 20 indicating their preference for this person. 0 means total dislike, 20 on the other hand means that this person is considered ideally suited for the jury.
Based on the grades of the two parties, the judge selects the jury. In order to ensure a fair trial, the tendencies of the jury to favour either defence or prosecution should be as balanced as possible. The jury therefore has to be chosen in a way that is satisfactory to both parties.
We will now make this more precise: given a pool of n potential jurors and two values di (the defence's value) and pi (the prosecution's value) for each potential juror i, you are to select a jury of m persons. If J is a subset of {1,..., n} with m elements, then D(J ) = sum(dk) k belong to J
and P(J) = sum(pk) k belong to J are the total values of this jury for defence and prosecution.
For an optimal jury J , the value |D(J) - P(J)| must be minimal. If there are several jurys with minimal |D(J) - P(J)|, one which maximizes D(J) + P(J) should be selected since the jury should be as ideal as possible for both parties.
You are to write a program that implements this jury selection process and chooses an optimal jury given a set of candidates.
在一个古老的国家,法庭上的陪审团是一些普通人组成的。审判开始前,要先挑选陪审团。方法如下--首先随机选出一些人。这些人都有两个属性--defense 和prosecution(辩护和检举,且值在0—20之间)。为了是审判尽可能的公平,法官希望选出的陪审团的defense和
prosecution值尽可能相差不大。题目给出N个人,第I人有属性值di and pi,你从中选出M个人,使的其di的和D(J)与pi的和P(J)的|D(J) - P(J)|最小,而D(J) + P(J)最大。
- POJ 1015题意
- POJ 2553-题意很重要...
- POJ 1101 简单BFS+题意
- 题意!!!
- poj 2159题终于明白题意了
- poj 2856 水题 题意难理解
- poj 2603 注意理解题意 数论
- POJ 1799 几何题目 题意简单明了
- poj 2531 Network Saboteur(DFS,题意)
- POJ 1207 (跟着题意走)
- POJ 1547 Clay Bully 结构体数组使用题意理解
- POJ 1036 Gangsters -- 常规dp 题意好难懂啊
- POJ 2470 Ambiguous permutations(简单题 理解题意)
- POJ 3518 Prime Gap题意好难理解
- POJ 2828 Buy Tickets 题意&题解&代码(c++)
- 【POJ 2104】K-th Number 题意&题解&代码(c++)
- 【POJ 1451】T9 中文题意&题解&代码(c++)
- 【POJ 3461】Oulipo 中文题意&题解&代码(C++)
- DECODE函数
- JS中自动执行函数小结
- 云计算淡定从容的大局观
- SQL 知识
- microsoft office visio2003产品密钥
- POJ 1015题意
- 关于C#
- 祝贺一下,本本换系统了,WIN7初登场~!
- 从网页中调用QQ聊天
- 探讨封装类java
- 第二章 2绘制线条简单图形
- c/c++中堆栈的区别
- tomcat6.0配置
- AfxBeginThread和CreateThread具体区别