srijon_32's blog

By srijon_32, history, 3 weeks ago, In English

I was looking for a solution to a problem. I saw this in a function of that solution:

bool good(ll mid) { ll x = sqrt ( mid ); while( x * x > mid ) x-- ; while( ( x + 1 ) * ( x + 1 ) <= mid ) x++ ; return mid -x >= k; }

how is it possible that: sqrt ( mid ) * sqrt ( mid ) > mid ? or ( sqrt ( mid ) + 1 ) * ( sqrt ( mid ) + 1 ) <= mid ?

all this sqrt has floor value.

That problem link: https://codeforces.me/contest/2020/problem/B

Full text and comments »

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

By srijon_32, history, 2 months ago, In English

How can I contribute Question in Contests?

Full text and comments »

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