- 3
- 0
- 约1.08万字
- 约 7页
- 2021-06-08 发布于湖北
- 举报
ACM-ICPC (重邮赛区)参赛队培训专题计划
培训专题及其所占比例:
1) 搜索: 10%
2 ) 动态规划: 15%
3 ) 贪心算法:约 5%
4 ) 构造:约 5%
5 ) 图论:约 10%
6 ) 计算几何:约 5%
7 ) 纯数学问题:约 20%
8 ) 数据结构:约 5%
9 ) 其它:约 25%
第二次专题——动态规划
(1)Jury Compromise
Description
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
defences value) and pi (the prosecutions 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.
Input
The input file contains several jury selection rounds. Each round sta
您可能关注的文档
最近下载
- 2025年安徽省公务员行测真题(各地真题).docx VIP
- 八年级语文下册第三单元知识梳理与解析.docx VIP
- 内蒙古呼和浩特市2025-2026学年高一上学期期末考试政治试卷(含答案).pdf VIP
- 湖北省黄石市2025-2026学年高二上学期2月期末语文试卷(含答案).pdf
- 人教版八年级语文下册第一单元知识梳理全套.docx VIP
- (人教版)2025年高一物理寒假衔接讲练 ②寒假预习-第07讲 竖直平面内的圆周运动(教师版).doc VIP
- Simon考官9分大作文范文合集.pdf VIP
- 《眼视光技术》高阶课程-眼压计.pptx VIP
- 八年级语文下册第一单元的知识要点梳理.docx VIP
- Sony索尼耳机WH-1000XM2用户手册.pdf
原创力文档

文档评论(0)