← Back to topics
Topic

Z-zidar

i
isego1
Can anyone help me and tell me why am I getting MLE in this task?

My code: http://www.z-trening.com/submit.php?submit=7100267558&subm_code=1
h
halil
Line: if(middle*middle, ...
middle*middle can be long long int, but temporary result is stored in int.
I think there problem in function 'korijen'. Even yuo fix that problem, latter will be TLE.
i
isego1
Thanks! Now I haven't anymore MLE, but I have 8/20, last 12 cases TLE. Some hints...??
h
halil
http://z-trening.com/submit.php?submit=7100267697&subm_code=1
i
isego1
Thank you very much, only difference was that I searched square root with with my binary search and you used function sqrt from <cmath>