← 返回 meta 的题目列表Rank Stories and Filter by Offset
类型:online_judge
Implement a function rank_story(offset: int) that fulfills the following requirements:
There is a function call get_story() which returns a set of pairs like [[st1, 25], [st2, 99]], where each pair consists of a story name and its rank.
The function must return at least 5 story names since get_story() might occasionally return only 1 or 2 results; thus, it is necessary to repeatedly call get_story() to gather enough data.
For the same story name, if returned multiple times, the rankings must be accumulated.
Only keep stories with a ranking greater than the input offset.
The returned results should be sorted in descending order based on ranking.
Example
Input
50