ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 2110. Remove or Maximize

Any hints?
Posted by Cebotari Vladislav 29 Dec 2016 20:43
I have tried with a greedy algorithm but gives WA#8, any tests pls?
Re: Any hints?
Posted by Jane Soboleva (SumNU) 29 Dec 2016 21:53
3 1
2 5 6
Answer 7.
Re: Any hints?
Posted by Cebotari Vladislav 30 Dec 2016 13:29
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?
Posted by Jane Soboleva (SumNU) 30 Dec 2016 22:50
Hard to tell your problem without a code.
Re: Any hints?
Posted by Manciu Ion 3 Feb 2017 12:53
3 1
3 6 12
Answer: 15
Re: Any hints?
Posted by mms 5 Mar 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?
Posted by Cebotari Vladislav 15 Mar 2017 19:43
Manciu Ion , yes, for me is 15.

For mms: Mine gives 31 too

Edited by author 15.03.2017 19:44