What We Did Today:
- Went over implementation details for Feeding The Cows.
- Went over the Majority Opinion problem (medium difficulty)
Homework:
- Code up the optimal solution for Majority Opinion, and submit your answer to the webpage and google drive when you are finished
problem: https://usaco.org/index.php?page=viewproblem2&cpid=1371Key idea for implementation:A hay type can only be a possible final answer if it can grow and overtake all the other preferences. The rule states that a hay type overtake happens when >half of the cows in a focus group like the same hay type.Hint: DON’T think about how to select the size of a focus group or which grouping to make, but rather think about what conditions must be true for any hay type to overtake the rest.
Notes:
You can reach out to me at ddjapri@ayclogic.com if you have any questions!
You can find class notes here (Tues7PM_IntroToCompProgramming is our excel sheet for visuals).