시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 0 | 0 | 0 | 0.000% |
The popular TV show, “90%”, is conducting a live SMS poll every week. Each poll simply consists of a question followed by k choices, numbered from 1 to k. The audiences are asked to vote to the choices by sending a number from to to the program's phone number via SMS. The poll statistics is shown instantly during the program.
The Parliament has recently got suspicious over the statistics broadcasted by this TV show last week, and has hired a committee to investigate the issue. The committee has obtained the list of all SMSs sent to the last program of 90%, and is going to process the data for investigation. The poll under investigation has only four choices.
Since the number of SMSs is pretty high, the committee is asking you to write a computer program to extract the poll statistics from the SMS raw data. The data is provided to you as a list of phone:content pairs, where phone is the sender’s phone number, and content is the SMS content, presumably containing the sender’s vote. Your task is to compute the percentage of votes for each of the choices, and report it to the committee. There are some points to be considered in processing data:
There are multiple test cases in the input. The first line of each test case contains a positive integers n(1 ≤ n ≤ 10,000), which indicates the number of SMSs in the list. The next n lines, each contains a pair a:b, where a is a phone number, and b is the SMS content. The content of each SMS is at most 30 characters where each character is an alphanumeric character or belongs to the set{“:”,“+”, “-”,“(”,“)”}. The input terminates with a line containing a single “0” which should not be processed. To make your life easier, it is guaranteed that there is no space character in the input.
For each test case, output four lines on the standard output, where line i contains the percentage of votes given to the ith choice. The percentages must be truncated to integers. Then, output the total number of participants in the poll, discarding duplicates SMSs. The format of the output must conform to the format indicated in the Standard Output below.
6 09128122190:1 +98211100:+1 +98(912)812-2190:4 +311(20)590-4359:2 6616:1 02166-16-00-22:2 8 6616:1 0216616:2 +98216616:3 +98(21)66-16:4x 9090:1 8080:2: +1(519)708-2040:3 (519)708-2040:3:1 0
50% 50% 0% 0% Participants:5 66% 0% 33% 0% Participants:5
ICPC > Regionals > Asia West Continent > Iran > Tehran Site 2013 B번