PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#BS0000084. Kiểm tra số chính phương (Valid Perfect Square)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Kiểm tra số chính phương (Valid Perfect Square)
Valid Perfect Square
Source: LeetCode
Version: Phuoc Hung OJ Extended
Problem Statement
A positive integer is a perfect square if it is the square of an integer. Determine whether a given positive integer is a perfect square, without built-in square-root functions.
Input
A single line contains .
Output
Print true if some integer satisfies , otherwise false.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
16
Output
true
Explanation
For , the integer satisfies , so print true.