Let $x$ be a positive integer and let $y$ be a real number such that $y=\sqrt{x}$
Objectives:
If $y$ is an integer, find it in polynomial time.
If $y$ is not an integer, prove that there is no integer solution in polynomial time.
Is there any algorithm which can do that?