#K9986. Perfect Square Checker
Perfect Square Checker
Perfect Square Checker
You are given a positive integer \(N\). Your task is to determine whether \(N\) is a perfect square. A number \(N\) is called a perfect square if there exists an integer \(x\) such that \(x^2 = N\). In mathematical terms, you need to check if there exists an \(x\) with
[ x^2 = N ]
If no such integer exists (or if \(N < 1\)), you should output False
. It is recommended to implement an efficient solution using the binary search algorithm to achieve optimal time complexity.
inputFormat
The input consists of a single line with one integer \(N\) provided via standard input.
outputFormat
Print True
if \(N\) is a perfect square, otherwise print False
to standard output.
16
True