beowulf's blog

By beowulf, history, 7 years ago, In English

The 30692159 gives an error on test 9; if anyone can point out the mistake in the code i'd grateful.

Working:

I first formed an array that stores the maximum value of the input numbers upto the current index.

I then formed an array that stores the maximum value of p*ai+q*aj for a particular j.

  • Vote: I like it
  • 0
  • Vote: I do not like it