# | Problem | Pass Rate (passed user / total user) |
---|---|---|
14312 | Movie Rating System |
|
14313 | Market Fruit Hunt |
|
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
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.