問題一覧 > 通常問題

No.1218 Something Like a Theorem

レベル : / AI推定難易度 : 214 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 327
作問者 : anagohirame / テスター : first_vil
お気に入りにしたユーザー ProblemId : 4732 / 自分の提出
問題文最終更新日: 2020-08-24 19:33:41
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 264 (順位表) の他の問題:

Problem Statement

You are given positive integers $n,\ z$. Does there exist a pair of two positive integers $(x,\ y)$ such that $x^n+y^n=z^n$ holds?

Input

$n\ z$

  • All inputs are integers
  • $1\le n\le 100$
  • $1\le z$
  • $z^n\le 10^6$

Output

Print Yes on one line if a pair of two positive integers $(x,\ y)$ satisfying the condition exists, and No if it does not.

Sample

Sample 1
Input
2 5
Output
Yes

For example, $(x,\ y) = (3,\ 4)$ satisfies the condition. $(\because 3^2 + 4^2 = 5^2)$
$(x,\ y) = (5,\ 0)$ does not satisfy the condition because $y$ is not a positive integer.

Sample 2
Input
3 100
Output
No

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