![]() |
Weekly Problems #01 |
Pedro Ribeiro - DCC/FCUP |
This is one of 10 weekly problem sets. Each one is worth 12% of the grade of the "Submitted Implementation" evaluation criteria.
6 proposed problems:
Use a map to associate each value to its frequency. At the end, knowing that a certain value x has frequency fx, what is the minimum number of removals we need to do to make it part of a cool sequence?
Use a map to store course combinations and then sum the frequency of all those with a maximum frequency. What type should be a course combination? (careful with the order of the elements within the combination)
Use a map to store the last position each element was seen and try to keep record of the largest sequence of unique songs ending on the current position ;)
Simulate the battle using two (multi)sets/priority_queues
Initially there is a single segment withouth lights. Each time a traffic light is added, it will break an existing segment in two smaller ones. Can you keep track of all segments without lights?
How can we know the median as we traverse all the windows? Knowing the median can we compute the cost?
About the delivery:
Pedro Ribeiro - DCC/FCUP | Last update: