10747 - Maximum Subsequence

All about problems in Volume 107. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10747 - Maximum Subsequence

Post by brianfry713 » Thu Feb 27, 2014 11:11 pm

To pick 12 of 13 you have 13 choices.
If you don't include the 0 the product will be negative as you have 3 negatives. So the maximum product will be 0.
The maximum sum occurs when you don't include the -48, so the correct answer is 102 and that agrees with my updated AC code.
The judge's input must not have a case like this if other AC codes give different answers.
Check input and AC output for thousands of problems on uDebug!

Post Reply

Return to “Volume 107 (10700-10799)”