Comments

3250.

On ilyakrasnovvCodeforces Round #773, 4 years ago
0

How it could be!You just copy the limit before.It's ugly.Reflect your behaviour before blaming the problems.

Wait!Could you get into the editorial?

I don know that!Thank you.

Now you can still HACK others, right?

What kind of time of sending tutorial is normal? Looking forward to the solution.QWQ

+6

I hope.

On AgnimandurCodeforces Round #736, 5 years ago
+11

The tutorial seems still wrong now.I hope Agnimandur knows it.

B: #include <bits/stdc++.h> #define ri register int #define ll long long using namespace std; ll n; int main() { scanf("%lld",&n); ll l=1,r=n; while(l<=r) { ll mid=(l+r)>>1; if((2*n+2)/mid>=mid+1)l=mid+1; else r=mid-1; } printf("%lld\n",n+1-r); return 0; } Why is this code correct? I cannot understand the division in the bisection method. "(2*n+2)/mid>=mid+1" has no error?