For SMRSTR, you could use a language which supports large integer values (python or Java).
@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.
In the solution of the 4th question, I do not understand, how he has defined the dp states.
@vijju123, pleaseeee have a look at the formatting of LRQUER editorial⌠I tried to use latex feature, but couldnâtâŚ
Help!!