|
|
back to boardCAN ANYONE TELL ME TEST#2?? GREEDY STRATEGY I am using greedy strategy coeff = (unhappiness - possible reduced unhappiness)*length of line x is position to cut the line for min unhappiness ::::: add main list to priority queue with initial unhappiness while(cuts<K){ remove List with max coeff; cut in 2 parts for min unhappiness, calc coeff (for each list); add the 2 parts of list to queue; cuts++; } then poll all queue members(i.e. all cut lines) and add their unhappiness I'm getting all posted tests right.. I tried all variations I could, and I'm getting right answers, but I am getting WA#2, please help!!!! Edited by author 30.12.2013 21:16 |
|
|