2493 - 2022GEC1506 - HW2 Scoreboard

Time

2022/03/15 23:30:00 2022/03/29 00:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12730 Variable Operation
12731 GEC1506 - Advanced - Scoreboard Parsing

12730 - Variable Operation   

Description

Given 4 lines of text, you need to parse it and perform data operations to fit the requirement.

Hint

You may also need the function round() to limit the digit numbers of float.
An example is shown below where 5.123456 is the original number and 1 (or 2) is the number of digits to preserve.

>>> print(round(5.123456, 1))
5.1
>>> print(round(5.123456, 2))
5.12

Input

4 lines of text with the following syntax:

e1

e2

e3

e4

where e1, ... , e4 represented 4 elements from given text.

Output

A line of text with the following operations:

e1 multiply e2  plus  e4 multiply e3 

Note that the details of the operations are:

  • e1 multiply e2 should be numbered multiplication and round the multiplication to only first decimal
  • e4 multiply e3 should be the string multiplication
  • e1, e2, e3 are considered as numbers, while e4  is a word.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss




12731 - GEC1506 - Advanced - Scoreboard Parsing   

Description

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

Input

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

The format of each line is given as: 

User, Answering Result, Total Passed Cases

Examples are shown below.

GEC2_105071035,3\3,3

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

 

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

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