No.2190 Last 12 Digits of a Square Number
Problem Statement
You are given a string $S$ of $12$ characters, consisting only of half-width digits from $0$ to $9$.
Determine whether there exists a square number with $13$ or more digits whose last $12$ digits are equal to $S$.
Input
The input is given from standard input in the following format:
$S$
Constraints
The input satisfies the following constraints:
- $S$ is a string of $12$ characters, consisting only of half-width digits from $0$ to $9$
Output
Print YES if there exists a square number with $13$ or more digits whose last $12$ digits are equal to $S$, and NO otherwise.
Print a newline at the end.
Sample
Sample 1
Input
000000000000
As shown here, the input may begin with $0$.
Output
YES
An example of a square number with $13$ or more digits whose last $12$ digits are equal to $000000000000$ is
$\displaystyle 1000000000000 = 1000000^2 $
.
Sample 2
Input
000000000001
Output
YES
An example of a square number with $13$ or more digits whose last $12$ digits are equal to $000000000001$ is
$\displaystyle 1000000000002000000000001 = 1000000000001^2 $
.
Sample 3
Input
000000000002
Output
NO
There is no square number with $13$ or more digits whose last $12$ digits are equal to $000000000002$.
Sample 4
Input
290312864656
Output
YES
An example of a square number whose last $12$ digits are equal to $290312864656$ is
$\displaystyle 10596290312864656 = 102938284^2 $
.
Sample 5
Input
267589775753
Output
NO
There is no square number with $13$ or more digits whose last $12$ digits are equal to $267589775753$.
Related Problems
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。