Maximum of (a[i]+a[j])*(j — i) where j > i

Правка en1, от amr0, 2021-02-06 07:54:21

Hello Codeforces! I was trying to solve https://codeforces.net/gym/102920/problem/L using divide and conquer. To get the solution that crosses the midpoint I use the observation that the left endpoint, at index i, will be in a monotonically increasing sequence and the right endpoint, at index j, will be in a monotonically decreasing sequence but I get TLE. This is a code snippet from the code I submitted: https://ideone.com/pRWLDD . Your help is appreciated

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский amr0 2021-02-06 07:54:21 505 Initial revision (published)