Find an instance that forces the Engineers method to have as large a performace
ID: 3552519 • Letter: F
Question
Find an instance that forces the Engineers method to have as large a performace retion as possible. It is possible to get 1.16... but not much higher.
Explanation / Answer
1) let's sort the stones descending.
2) i=1
3) A is the index of the lightest sack (or first if they have equal weight)
4) put m[i] stone to S[A], S[A] += m[i]
5) i++
6) if there are stones left (i <= n) then goto 3
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.