|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||128 MB||0||0||0||0.000%|
It’s a pity that there is no higher-order contest for ACM ICPC regionals and subregionals; probably this is because it’s very hard to rank them. But now we have an idea how to do this! The idea is based on a notion of negidealness — a number showing non-conformity of the contest results with “ideal” contest criteria. It is a weighted sum of the following specific negidealnesses (penalties).
Vainness penalty V . Each team should solve at least one problem. If a team solves no problems, a penalty of 1/T (where T is the number of teams that participated in the contest) for each such team is added.
Oversimplification penalty O. There should be no team with all the problems solved. If some teams solve all the problems, a penalty of 1/T is added for each such team.
Evenness penalty E. The number of problems solved by different teams should increase evenly. If the difference in problems solved between two adjacent (in the standings) teams is greater than 1, then the penalty of 1/P (where P is the total number of problems) is added for each skipped number of problems solved. E.g., if a team solves 5 problems, and the next team solves 1 problem, then the penalty of 3/P should be added, since no team solved 2, 3 or 4 problems.
Unsolvability penalty U. Every problem should be solved by at least one team. If a problem is not solved, a penalty of 1/P for each such problem is added.
Instability penalties I1, I2, . . . , IP. If a problem p was solved by a team, then this problem should be solved by all the teams ranked above. For each team which did not solve problem p ranked above the lowest-ranked team that did solve problem p a penalty of 1/T is added to Ip.
The total negidealness N equals 1.03V + 3.141O + 2.171E + 1.414U + (I1 + I2 + · · · + IP)/P.
Write a program that finds the negidealness of the given results table.
The input file contains a contest results table in plain ASCII. The only whitespace symbol in the table is a space. There is always at least one space separating columns. The problems are named with capital English letters in the alphabetical order. There are at most 26 problems and at most 300 teams.
The output data should contain the penalties for each criterion (values V , O, E, U, I1, . . . , IP) and the total negidealness. All the real numbers should be precise up to 3 digits after the decimal point.
The contest header may contain arbitrary number of lines Team A B C D E = Time R ------------------------------------- Revda STU + + +2 +1 -9 4 9274 1 Girvas NU #1 + + -1 . -11 2 321 2 Kargopol SU + -3 + . -4 2 321 2 Utorgosh SU . . . + -5 1 122 4 Dubrovno SU . + -1 . -4 1 123 5 Girvas NU - 2 . . . -5 -99 0 0 6
Vainness = 0.167 Oversimplification = 0.000 Evenness = 0.200 Unsolvability = 0.200 Instability 1 = 0.000 Instability 2 = 0.333 Instability 3 = 0.000 Instability 4 = 0.333 Instability 5 = 0.000 Negidealness = 1.022