Algorithm/Mathmatics2 [CODEFORCES] Card Deck Problem You have a deck of n cards, and you'd like to reorder it to a new one. Each card has a value between 1 and n equal to $p_i$. All $p_i$ are pairwise distinct. Cards in a deck are numbered from bottom to top, i. e. $p_i$ stands for the bottom card, $p_n$ is the top card. In each step you pick some integer k > 0, take the top k cards from the original deck and place them, in the order they .. 2021. 3. 25. [CODEFORCES] Three Swimmers Problem Three swimmers decided to organize a party in the swimming pool! At noon, they started to swim from the left side of the pool. It takes the first swimmer exactly a minutes to swim across the entire pool and come back, exactly b minutes for the second swimmer and c minutes for the third. Hence, the first swimmer will be on the left side of the pool after 0, a, 2a, 3a, ... minutes after th.. 2021. 2. 24. 이전 1 다음