invoker._'s blog

By invoker._, history, 2 years ago, In English

So here is the problem

Let array A = { a1,a2,a3,...an} postitive integers

F(i,j) = min(ai,ai+1,....,aj) * (i-j+1);

Find the maximum value of F(i,j) for any I and J.

Example: A = {5,3,1,1}

(I = 1 J = 2) : SUM = 6

Example: A = {3,1,3,1,2}

(I = 1 J = 5) : SUM = 5

Full text and comments »

  • Vote: I like it
  • +7
  • Vote: I do not like it

By invoker._, history, 2 years ago, In English

Problem link: 1654C - Alice and the Cake

I tried solving the problem with a different approach. It would be great if someone helps me analyze the time and space complexity of my submission, because I feel it should be within constraints and somehow it fails!

Thanks for your time reading :)

152639386

Problem solved: see ACGN reply

Full text and comments »

  • Vote: I like it
  • +8
  • Vote: I do not like it