@bazsi700 , when I change the datatype to double, it is passing 1st test case but when I change it to long double it is passing only 2nd test case, why?(isn’t first test case a sub set of 2nd) I just want to know what’s happening behind…
No, Rating are updated only upto November Cook Off.
@vipin_bhardwaj To avoid double precision issues. The sum of A_L and A_R may be odd, this is why we need double, but double can have precision issues, so you can’t use = sign on doubles.
E.g. if you have this code:
double x = 2;
x = (x*5)/2;
then probably x == 5 expression will be false, because x will be something like 4.999999 or 5.0000001.
That’s why you should always compare doubles with an error, which I chose 0.01.
Well this time , both of us missed the contest.
I didn’t miss contest, it went badly for me (my worst till now)
Wow… please tell me this one also
let a[l] + a[r] = 5 than we will be finding value in array which is closer to 2 or 3, what should we choose.
I used (l+r)/2 for floorkey and (l+r+1)/2 for ceilkey, no messing with double.
That thing was hard af to debug. I cant believe I missed that. set lowerbound and normal lowerbound. The more you know about STL XD
@vijju123 It took me 2 hours of thinking and googling to find it out. Glad to share it with others, and spare their time
@taran_1407 There wasn’t too much messing
@vijju123 - Sorry xD i will try to put more readable code with some documentation before asking for help next time. Thank you for your efforts! and thanks bazsi once more.
@vijju123, pleaseeee have a look at the formatting of LRQUER editorial… I tried to use latex feature, but couldn’t…
Help!!