My friend submitted https://codeforces.com/contest/1809/submission/198820962 this code during the contest and got the wrong answer. He submitted with GNU C++20 (64). I submitted his code in another version (GNU C++17) and the code got accepted. Accepted code link : https://codeforces.com/contest/1809/submission/198864459
Auto comment: topic has been updated by ReCRuS (previous revision, new revision, compare).
No, because sqrt has precision issues and it might give different answers each time