Find a square root · Compiler

Find a square root

A square courtyard has n tiles arranged in equally many rows and columns. Use binary search over nonnegative integers to find the exact number of tiles along one side.

Input
One integer n from 0 to 1000000, guaranteed to be a perfect square.
Output
Print the nonnegative integer whose square is n.

Compiler Explorer runs your code when you run or check it.

Loading your exercise draft…