m_nigam01's blog

By m_nigam01, history, 3 months ago, In English

Hello all,

I have tried to solve the question using given k values. So if current k doesn't satisfy the condition i look to the left and to the right and whichever side gives me smallest one i consider that side and discard the other half.

c++ code https://codeforces.com/contest/1805/submission/235224707

python code https://codeforces.com/contest/1805/submission/235213482

Thank you.

  • Vote: I like it
  • -1
  • Vote: I do not like it

3 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it


It seems i can't message more than 2 times in a hour so writing here.

for you reference solution exists if (b-k)**2<4*a*c

let say for current k is absolute(b — k) ** 2 >= 4 * a * c this condition holds. Now i'm checking absolute(b-(k-1))=k.

Similarly checking for absolute(b-(k+1))