What is the difference between the prewritten sqrt function that I used here : https://codeforces.net/contest/1737/submission/222667221 and my own written sqrt function that I wrote here : https://codeforces.net/contest/1737/submission/222667916?
I understand stuff about precision and things like that, but I'm just rounding down, so even if something is like 2.0000067 it should still yield the correct answer. Please explain! I feel like this just happens over and over again: everytime I use sqrt(x) it always fails to get AC and I have to write my own sqrt function, even if my algo is correct.
Inbuilt square root functions loose precision for bigger numbers like 1e18 in cpp you can use sqrtl (that gives correct ans always) or this function