A. Lost Victor
- Concepts: Simulation
- Complexity: $O(n)$
given $n$ teams and the results on the 6 questions in this contest, work out who won based on their score and time penalty.
to do this what you needed to do was
- keep track of the best score and time taken
- go though every team add their score and time taken
- if the score is higher then the best score set this to be best score and time
- if score is tied but has a smaller time set the time to be best time
- output result
Solutions
- Python Solution(Rory)
- C++ Solution(Patrick)
B. Overhand Shuffle
An observation we can make is that the top card never changes and from here you can simulate all the steps. You could just track the current index, and subtract one to it if it is not at the end, and change it to the second-front if it is at the end.
- Python Solution(Rory)
- Python Optimal Solution(Rory)
- C++ Solution (Patrick)
- C++ Optimal Solution (Patrick)