#P1319. 2023.6.2-TikTok春招(澳大利亚区域)-第五题
2023.6.2-TikTok春招(澳大利亚区域)-第五题
Related
In following contests:
Introduction One of the features TikTok is renown for is its video feeds. Users can seamlessly swipe through many videos with next to no loading time, and the recommendation algorithm will take care of ordering them judiciously. The "Following Page' is one of them, and shows videos from accounts that the user follows.
Given n users identified by a unique id between 1 and n, a list of videos published by these users and a list of following/followed relationships, your task is to recreate each user's following' feed. Each feed is a list of at most 5 of the user's followed accounts' videos ordered by descending publication time (from newest to oldest). Note that some users may not follow anyone or not follow anyone who has posted a video, inwhich case their feed will be empty , in this case , you should ouput 'None'. lt is also possible that a user have published less than 5 videos, in which case their followers will see all of them.
Example
In following contests:
本题属于以下题库,请选择所需题库进行购买