You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
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
扫码备注加群即可,期待您的到来~
本题属于以下题库,请选择所需题库进行购买