Комментарии
На SpyrosAlivCodeforces Round 1020 (Div. 3) Editorial, 12 месяцев назад
0

I am stuck on problem D

My approach is that i can find the number of flowers in prefix and suffix of each index

Then if prefix[i]+suffix[i]>=m ans=0; else if prefix[i]+suffix[i]==m-1 ans=min(ans,b[i])

Here is my code

https://mirror.codeforces.com/contest/2106/submission/317047928

Please help