Блог пользователя invoker._

Автор invoker._, история, 2 года назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • +7
  • Проголосовать: не нравится

Автор invoker._, история, 2 года назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится