2301 - GEC1506-2021 - HW3 Scoreboard

Time

2021/04/06 23:30:00 2021/04/20 00:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12758 Scoreboard Parsing (cont'd) (Advance)
13165 GEC1506-top or min

12758 - Scoreboard Parsing (cont'd) (Advance)   

Description

Calculate the score of students from the NTHU OJ scoreboard based on how many test cases a student has passed.

This is a continued problem from Problem 12731. (https://acm.cs.nthu.edu.tw/problem/12731/)

Input

Multiple lines of score information, where each line is an answering record for a user account.

Now the number of questions for a contest could have more than 1.

First line is the weight for each question.

Weight_for_problem_1  Weight_for_problem_2  ...  Weight_for_problem_N

The format of each line after line 1 is given as: 

Rank, User, Problem 1 Result, Problem 2 Result, ... , Problem N Result, Total Passed Cases

Examples are shown below.

1,GEC2_105071035,3\3,2\5, ...,0\1,12

The 3\3 of Answering Result denotes passed_cases\total_cases of a problem.

 

The score of a question is calculated as the number of passed test cases divided by the total number of test cases within a question.

The score of a student is calculated as the weighted average score of all questions.

In case one doesn't understand the definition of the weighted average, the formula is also provided below.

weighted average

Output

The score for each student of the given contest with the format:

User,Score

Note that

  1. The order of the output score should follow the same order of the input.
  2. The score should have 2 decimals.

Sample Input  Download

Sample Output  Download

Tags




Discuss




13165 - GEC1506-top or min   

Description

Given a list of numbers and an indicator,

you need to find out the maximum or minimum number in the list according to the indicator.

Input

There is only one line in the input, which contains the list of numbers and the indicator.

An example is shown below.

9,0,21,i1,61,66,91,62,83,22,22

Note that

  1. The red element in the line is the indicator where you can find it with the character "i" and the following digit is the indicator. (1 in this example). When you meet indicator 1, you need to find the maximum; and 2 to find the minimum.
  2. The remaining blue elements are the numbers of the list of numbers.

Hint:

x = [1, 2, 3, 4, 5]

print( min(x))# output: 1

print( max(x)) # output: 5

Output

The output is a line of text with the maximum/minimum number from the list.

Sample Input  Download

Sample Output  Download

Tags




Discuss