問題一覧 > 教育的問題

No.2185 Last 6 Digits of a Square Number

レベル : / AI推定難易度 : 312 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 101
作問者 : 👑 p-adic / テスター : 👑 qand
お気に入りにしたユーザー ProblemId : 8478 / 自分の提出
問題文最終更新日: 2022-11-16 10:33:14
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 373 (順位表) の他の問題:

Problem Statement

You are given as input a string $S$ of $6$ characters consisting only of the half-width alphanumeric characters from $0$ to $9$.

 

Determine whether there exists a square number with $7$ or more digits whose last $6$ 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 $6$ characters consisting only of the half-width alphanumeric characters from $0$ to $9$

Output

Print YES if there exists a square number with $7$ or more digits whose last $6$ digits are equal to $S$, and NO otherwise.

Print a newline at the end.

Sample

Sample 1
Input
000000

As shown here, the input may begin with $0$.

Output
YES

An example of a square number with $7$ or more digits whose last $6$ digits are equal to $000000$ is $1000000 = 1000^2$.

Sample 2
Input
000001
Output
YES

An example of a square number with $7$ or more digits whose last $6$ digits are equal to $000001$ is $1000002000001 = 1000001^2$.

Sample 3
Input
000002
Output
NO

There is no square number with $7$ or more digits whose last $6$ digits are equal to $000002$.

Sample 4
Input
864656
Output
YES

An example of a square number whose last $6$ digits are equal to $864656$ is

$\displaystyle 10596290312864656 = 102938284^2 $

.

Sample 5
Input
830823
Output
NO

There is no square number with $7$ or more digits whose last $6$ digits are equal to $830823$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。