|
|
вернуться в форумAny hints? I have tried with a greedy algorithm but gives WA#8, any tests pls? Re: Any hints? 3 1 2 5 6 Answer 7. Re: Any hints? Yep, my answer is also 7. Still WA#8 here another tests for my program, can u check pls? 5 3 1245 5553 3112 677 1 answer -> 7609 8 2 12455 6666 3312 245 3432 666 421 444 answer -> 16383 Re: Any hints? Hard to tell your problem without a code. Re: Any hints? 3 1 3 6 12 Answer: 15 Re: Any hints? Послано mms 5 мар 2017 16:27 Greedy algorithm is wrong. Try this: 4 1 16 10 9 6 The answer should be 31 because 16 or 9 or 6 is 31. But the greedy algorithm gives 30. Re: Any hints? Manciu Ion , yes, for me is 15. For mms: Mine gives 31 too Edited by author 15.03.2017 19:44 |
|
|