3000 - 2024GEC1506 - HW4 Scoreboard

Time

2024/04/30 09:00:00 2024/05/12 23:59:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team
1 14312 - Movie Rating System GEC_X1120083 It's not clear that we need to provide uppercase or lowercase for the movie name? In the example, it's uppercase I change the example input. GEC_1506_Jessie 2024/05/01 14:32:14
2 14312 - Movie Rating System GEC_111006228 Hello im confused, because the question says in input will be lowercase but the testcase is upper case The question states: The score will be between 1 to 100, the length of a movie name will be between 2 to 10 and all in lowercase alphabet. But the Testcase is : QAZ 20 WSX 50 QAZ 30 WSX 70 QAZ 40 WSX 60 I change the example input. GEC_1506_Jessie 2024/05/01 14:32:44

# Problem Pass Rate (passed user / total user)
14312 Movie Rating System
14313 Market Fruit Hunt

14312 - Movie Rating System   

Description

Write a simple movie rating system that records users' ratings for different movies and can query the average rating for a specific movie.

 

Hint: You can use "in" to tell if the new movie name is in the dictionary or not.

 

This is the document of dictionary: https://docs.python.org/3/tutorial/datastructures.html#dictionaries

Input

Given a list of movies and the score of the movie.

Each line is the movie name and the score, separated by a space.

You will not know the number of movies.

The score will be between 1 to 100, the length of a movie name will be between 2 to 10 and all in lowercase alphabet.

Output

Please output the movie name that has the highest average score.

The average score should be rounded down to the nearest whole digit.

There is only one possible answer.

Sample Input  Download

Sample Output  Download

Tags




Discuss




14313 - Market Fruit Hunt   

Description

Jack's grandmother went to the market to buy fruit today. She saw that the fruits were special and happily put various fruits into her shopping bag as if she were crazy. Now she wants to know which fruit appears the most in her shopping bag. Can you help her figure it out?

 

Input

The input contains multiple lines, each line containing the name of a fruit.

Each fruit name consists of 1 to 10 letters and contains only lowercase English letters.

Output

Output the name of the fruit that appears the most in the shopping bag, along with the corresponding quantity. Separate the fruit name and quantity with a space.

If there are multiple fruits with the same maximum quantity, choose the fruit with the longest name.

Sample Input  Download

Sample Output  Download

Tags




Discuss