問題一覧 > 教育的問題

No.2190 Last 12 Digits of a Square Number

レベル : / AI推定難易度 : 1750 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 21
作問者 : 👑 p-adic / テスター : 👑 qand
お気に入りにしたユーザー ProblemId : 8479 / 自分の提出
問題文最終更新日: 2023-03-04 10:12:34
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 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$.

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