提交

#### 相关推荐

- 回答 2 已采纳 问题描述 : There are 3 people in a team of ACM/ICPC. Every member of the team will occasionally make some mistakes in the contest. So Mr.F tests every one and everybody gets a Mistake Value x. If the Mistake Values of the 3 members of a team are respectively a, b, c, then the Mistake Value of the team is m = min{ |a-b|, |b-c|, |c-a| }. Your job is to find the best plan to minimize M which is the sum of all the Mistake Value of teams. 输入: In the first line, there are two integers N and K. N is the number of people who will make teams and K is the number of teams which is supposed to make. (3<= N <=100000) (0<= k <= N/3 ) There are N lines followed. Each line has an integer D, which is the Mistake Value of the person.(0<=D<=1000000000) 输出: In the first line, there are two integers N and K. N is the number of people who will make teams and K is the number of teams which is supposed to make. (3<= N <=100000) (0<= k <= N/3 ) There are N lines followed. Each line has an integer D, which is the Mistake Value of the person.(0<=D<=1000000000) 样例输入: 7 2 1 5 3 2 4 7 9 样例输出: 2
- 4年前回答 1 已采纳 Who is cpcs? Every one in ZJU ACM-ICPC team knows him. Although he has been graduated from ZJU, he is still active in ZOJ and many contests. cpcs is the legendary figure in ZJU ACM-ICPC history. It is not only because he has passed nearly all the problems on ZOJ, but also because his very famous function name "gao" which is now widely spreaded and used by many ACMers. "gao" in Chinese means to do something but it's not that formal in grammar. So it is usually used verbally. In addition, "gao" can be explained as a spirit, a belief, even an attitude to life, which makes cpcs use "gao" as most of the function names (Of course there should be some functions named such as "main" in C or C++). One day, cpcs got a map of the city he lived in. There were N buildings (numbered from 0 to N - 1) in the map with the building he was in marked as 0. Between the buildings, there were some unidirectional roads. He then wrote a program with function "gao" that could calculate all the shortest paths from building 0 to all the building. Here, there might be more than one shortest paths to a building. Now he wanted to know, for each query of buildings, how many shortest paths that he figured out with function "gao" passed through the queried building. Note that if a building is unreachable from building 0, no shortest path would passes through it. Input There are multiple test cases. For each case, the first line is three numbers N, M, Q (1 ≤ Q ≤ N ≤ 10000, 1 ≤ M ≤ 50000) indicating the number of buildings, the number of roads and the number of queries. Next is M lines each containing three numbers a, b, d (0 ≤ a, b 1 0 -> 2 0 -> 1 -> 3 0 -> 2 -> 3 Therefore, building 0 appears 5 times in the shortest paths, while building 1, 2 and 3 each appears 2, 2, 2 times.
- 回答 1 已采纳 Description The International Clown and Pierrot Competition (ICPC), is one of the most distinguished and also the most popular events on earth in the show business. One of the unique features of this contest is the great number of judges that sometimes counts up to one hundred. The number of judges may differ from one contestant to another, because judges with any relationship whatsoever with a specific contestant are temporarily excluded for scoring his/her performance. Basically, scores given to a contestant's performance by the judges are averaged to decide his/her score. To avoid letting judges with eccentric viewpoints too much influence the score, the highest and the lowest scores are set aside in this calculation. If the same highest score is marked by two or more judges, only one of them is ignored. The same is with the lowest score. The average, which may contain fractions, are truncated down to obtain final score as an integer. You are asked to write a program that computes the scores of performances, given the scores of all the judges, to speed up the event to be suited for a TV program. Input The input consists of a number of datasets, each corresponding to a contestant's performance. There are no more than 20 datasets in the input. A dataset begins with a line with an integer n, the number of judges participated in scoring the performance (3 ≤ n ≤ 100). Each of the n lines following it has an integral score s (0 ≤ s ≤ 1000) marked by a judge. No other characters except for digits to express these numbers are in the input. Judges' names are kept secret. The end of the input is indicated by a line with a single zero in it. Output For each dataset, a line containing a single decimal integer indicating the score for the corresponding performance should be output. No other characters should be on the output line. Sample Input 3 1000 342 0 5 2 2 9 11 932 5 300 1000 0 200 400 8 353 242 402 274 283 132 402 523 0 Sample Output 342 7 300 326
- 回答 1 已采纳 Problem Description sd0061, the legend of Beihang University ACM-ICPC Team, retired last year leaving a group of noobs. Noobs have no idea how to deal with m coming contests. sd0061 has left a set of hints for them. There are n noobs in the team, the i-th of which has a rating ai. sd0061 prepares one hint for each contest. The hint for the j-th contest is a number bj, which means that the noob with the (bj+1)-th lowest rating is ordained by sd0061 for the j-th contest. The coach asks constroy to make a list of contestants. constroy looks into these hints and finds out: bi+bj≤bk is satisfied if bi≠bj, bi> 5; x ^= x << 1; t = x; x = y; y = z; z = t ^ x ^ y; return z; } Output For each test case, output "Case #x: y1 y2 ⋯ ym" in one line (without quotes), where x indicates the case number starting from 1 and yi (1≤i≤m) denotes the rating of noob for the i-th contest of corresponding case. Sample Input 3 3 1 1 1 0 1 2 2 2 2 2 2 1 1 Sample Output Case #1: 1 1 202755 Case #2: 405510 405510
- 4年前回答 2 已采纳 Soon after he decided to design a T-shirt for our Algorithm Board on Free-City BBS, XKA found that he was trapped by all kinds of suggestions from everyone on the board. It is indeed a mission-impossible to have everybody perfectly satisfied. So he took a poll to collect people's opinions. Here are what he obtained: N people voted for M design elements (such as the ACM-ICPC logo, big names in computer science, well-known graphs, etc.). Everyone assigned each element a number of satisfaction. However, XKA can only put K (<=M) elements into his design. He needs you to pick for him the K elements such that the total number of satisfaction is maximized. Input The input consists of multiple test cases. For each case, the first line contains three positive integers N, M and K where N is the number of people, M is the number of design elements, and K is the number of elements XKA will put into his design. Then N lines follow, each contains M numbers. The j-th number in the i-th line represents the i-th person's satisfaction on the j-th element. Output For each test case, print in one line the indices of the K elements you would suggest XKA to take into consideration so that the total number of satisfaction is maximized. If there are more than one solutions, you must output the one with minimal indices. The indices start from 1 and must be printed in non-increasing order. There must be exactly one space between two adjacent indices, and no extra space at the end of the line. Sample Input: 3 6 4 2 2.5 5 1 3 4 5 1 3.5 2 2 2 1 1 1 1 1 10 3 3 2 1 2 3 2 3 1 3 1 2 Sample Output: 6 5 3 1 2 1
- 4年前回答 1 已采纳 Problem Description Charles is the contest director for the ICPC Tumbolian regional contest. His responsibility is ensuring the contest flows smoothly, that the contest rules are applied fairly, and, of course, announcing the final contest ranking. According to ICPC rules, a team with more solved problems ranks above a team with less solved problems. If two teams have the same number of solved problems, the team with the smaller total penalty ranks above the team with the larger total penalty (in case both teams have the same number of solved problems and the same penalty, Charles considers them as tied). The total penalty for a team is the sum of all the problem penalties of the problems that team has solved. The problem penalty for a problem is TP +EP ×FA, where TP is the time penalty for that problem, EP is the contest’s error penalty and FA is the number of failed attempts at solving the problem before submitting a correct solution. The time penalty for a problem is the time since the start of the contest, in minutes, that the team needed to solve the problem. The error penalty is a positive integer chosen by the contest director, designed to reward teams that submit correct solutions on the first attempt. Charles wants to change the error penalty from the “standard” value of 20 minutes to stir things up. To study the effects of that change on the final rankings, he wants to know the range of error penalties that don’t change the final standings. In other words, if team A is ahead of team B in the original standings, then A should be ahead of B in the modified standings; if A and B are tied in the original standings, they should also be tied in the modified standings (the original standings are the ones obtained with an error penalty of 20 minutes). Charles has been very busy organizing the Tumbolian regional, so he asked you to make a program that will compute the range for him. Input The input contains several test cases. The first line of each test case contains two integers T and P separated by a single space, indicating the number of teams and the number of problems, respectively (2 <= T <= 100, 1 <= P <= 10). Each one of the next T lines describes the performance of a team. A team’s performance description is a line containing P problem descriptions separated by single spaces. Teams are not necessarily given in order of their final standings. Each problem description is a string “A/S”, where A is an integer representing the number of attempts that the corresponding team made at solving that problem (0 <= A <= 100), and S is either “-”, if the team did not solve that problem, or an integer indicating the number of minutes it took for the team to submit a correct solution (1 <= S <= 300). Attempts made after the first correct submission are not counted. The end of input is indicated by T = P = 0. Output For each test case in the input print two positive integers separated by a single space, indicating the smallest and largest error penalties that would not change the final ranking. If there is no upper bound for the error penalty, print a “*” instead of the upper bound. Sample Input 5 3 0/- 0/- 0/- 2/- 2/- 1/- 1/60 1/165 1/- 1/80 0/- 2/120 0/- 1/17 0/- 4 2 17/- 5/- 2/7 3/- 3/- 2/- 1/15 0/- 3 2 1/- 2/15 2/53 1/17 1/70 1/20 0 0 Sample Output 1 24 9 * 20 20
- 回答 1 已采纳 The twins named Tatsuya and Kazuya love chocolate. They have found a bar of their favorite chocolate in a very strange shape. The chocolate bar looks to have been eaten partially by Mam. They, of course, claim to eat it and then will cut it into two pieces for their portions. Since they want to be sure that the chocolate bar is fairly divided, they demand that the shapes of the two pieces are congruent and that each piece is connected. The chocolate bar consists of many square shaped blocks of chocolate connected to the adjacent square blocks of chocolate at their edges. The whole chocolate bar is also connected. Cutting the chocolate bar along with some edges of square blocks, you should help them to divide it into two congruent and connected pieces of chocolate. That is, one piece fits into the other after it is rotated, turned over and moved properly. Figure F-1: A partially eaten chocolate bar with 18 square blocks of chocolate For example, there is a partially eaten chocolate bar with 18 square blocks of chocolate as depicted in Figure F-1. Cutting it along with some edges of square blocks, you get two pieces of chocolate with 9 square blocks each as depicted in Figure F-2. Figure F-2: Partitioning of the chocolate bar in Figure F-1 You get two congruent and connected pieces as the result. One of them consists of 9 square blocks hatched with horizontal lines and the other with vertical lines. Rotated clockwise with a right angle and turned over on a horizontal line, the upper piece exactly fits into the lower piece. Figure F-3: A shape that cannot be partitioned into two congruent and connected pieces Two square blocks touching only at their corners are regarded as they are not connected to each other. Figure F-3 is an example shape that cannot be partitioned into two congruent and connected pieces. Note that, without the connectivity requirement, this shape can be partitioned into two congruent pieces with three squares (Figure F-4). Figure F-4: Two congruent but disconnected pieces Your job is to write a program that judges whether a given bar of chocolate can be partitioned into such two congruent and connected pieces or not. Input The input is a sequence of datasets. The end of the input is indicated by a line containing two zeros separated by a space. Each dataset is formatted as follows. w h r(1, 1) ... r(1, w) r(2, 1) ... r(2, w) ... r(h, 1) ... r(h, w) The integers w and h are the width and the height of a chocolate bar, respectively. You may assume 2 ≤ w ≤ 10 and 2 ≤ h ≤ 10. Each of the following h lines consists of w digits delimited by a space. The digit r(i, j) represents the existence of a square block of chocolate at the position (i, j) as follows. '0': There is no chocolate (i.e., already eaten). '1': There is a square block of chocolate. You can assume that there are at most 36 square blocks of chocolate in the bar, i.e., the number of digit '1's representing square blocks of chocolate is at most 36 in each dataset. You can also assume that there is at least one square block of chocolate in each row and each column. You can assume that the chocolate bar is connected. Since Mam does not eat chocolate bars making holes in them, you can assume that there is no dataset that represents a bar in a shape with hole(s) as depicted in Figure F-5. Figure F-5: A partially eaten chocolate bar with a hole (You can assume that there is no dataset like this example) Output For each dataset, output a line containing one of two uppercase character strings "YES" or "NO". "YES" means the chocolate bar indicated by the dataset can be partitioned into two congruent and connected pieces, and "NO" means it cannot be partitioned into such two pieces. No other characters should be on the output line. Sample Input 2 2 1 1 1 1 3 3 0 1 0 1 1 0 1 1 1 4 6 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 0 1 1 0 1 1 1 0 7 5 0 0 1 0 0 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 0 1 0 0 0 1 1 0 9 7 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 9 7 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 7 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 1 1 1 0 10 10 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 0 Output for the Sample Input YES NO YES YES YES NO NO YES
- 陈晨luminous的博客 【泰国普吉岛 - 2016年5月19日】本月19日，3名来自圣彼得国立大学的学生夺得了第40届ACM国际大学生程序设计竞赛(ICPC)全球总决赛冠军。此次竞赛由IBM赞助，由宋卡王子大学主办，吸引了来自40多个国家138支代表队共...
- Nemaleswang的博客 ~~~~~~~其实吧，青岛打完本来就是打算退役了的（都在寝室呆了好几天了，游戏都打了好几天了，电脑都搬回寝室了，飞车都跑了两个白金号出来了），然后xgg他们队伍是早就决定好要去EC的，所以本来都打算的退役队伍...
- 3年前CXY_Likescoding的博客 ACM国际大学生程序设计竞赛（英文全称：ACM International Collegiate Programming Contest（简称ACM-ICPC或ICPC））是由国际计算机协会（ACM）主办的，一项旨在展示大学生创新能力、团队精神和在压力下编写程序、...
- 小川先生的博客 很惭愧, 一把年纪了, 连人家的选拔赛都不能AK. 写写题解, 继续成长. 都是很基本的题目, 没有用到太多算法. 1001 签到题 =============================题目===================...ACM国际大学生程序设计竞赛(英文
- beckyUp的博客 题目大意： f(n) 表示 n =a*b （a,b 都为非 平方倍数） ，a,b不同时的对数 计算 f(1)+f(2)+…+f(n) ...举例 当 n = 8时 1的 贡献度 有 1*1 (1*2 ,1*3, 1*5,1*6，1*7 ) 后面这一部分要*2 1+5*2=11 2的贡献度 有 ...
- Accepted丶的博客 ACM-ICPC
- 12年前uqapuqap的博客 ACM国际大学生程序设计竞赛(英文全称:ACM International Collegiate Programming Contest（ACM-ICPC或ICPC）是由美国计算机协会（ACM）主办的，一项旨在展示大学生创新能力、团队精神和在压力下编写程序、分析和解决...
- hulu beijing的博客 11月18日至19日，ACM-ICPC亚洲区域赛（北京站）在北京大学举行。作为大赛赞助商，北京办公室的几位同事也来到赛场。比赛结束后，Hulu全球副总裁诸葛越做代表发言，简单介绍了Hul...
- 幻月瑶琴的博客 大学ACM/ICPC总结 来源： 陈志源的日志 注：本文将出现在最新一期的《创新中心案例汇编上》。 先个人简述下：07级本科，软件学院，09-10年创新中心ACM组组长。ACM/ICPC亚洲区3银1铜，东北地区2...
- steveyg的博客 刚来大学的时候就总听老师提起ACM，也总在知行看到各位大神的赛后总结，现在轮到我写了，第一次写总结，勿喷~ 先说说准备的过程，10月底开始整理模板，包括做题时遇到的新的问题，并且参考一些别人的已有的板子(T_T...
- weixin_39788740的博客 简历上要是出现了 ACM-ICPC 省级以上名次的关键词，这份简历就很难被遗漏，拿到面试基本上是板上钉钉的事情。用人单位喜欢 ACM 背景出身的候选人也不无道理。面试官也会担心被候选人的「牛皮」欺骗，当他无法全面...
- angyaju1815的博客 今日，正式进入比赛日。... 开幕式照舅，副校长、院长、秘书装、赞助商代表依次讲话，这次还请了一位前ACMer、现google高级工程师周一鸣（音）来谈参赛感想。之后同一地点继续技术报告，Xnazy留下听报告，我和jian...
- 13年前zen_chou的博客 一、ACM/ICPC简介ACM国际大学生程序设计竞赛（ACM/ICPC ：ACM International Collegiate Programming Contest）是由国际计算机界历史悠久、颇具权威性的组织ACM( 美国计算机协会）学会（Association for Computer ...