CodeDrill
day_streak: --
← 問題一覧に戻る
Python ・ Standard I/O

Problem 51: Is It a Prime Number?

An integer N is given on one line. If N is a prime number, output Yes; otherwise, output No.

A prime number is an integer of 2 or greater that has no divisors other than 1 and itself (1 is not a prime number).

Constraints

1 ≤ N ≤ 1000000

Input example 1

7

Output example 1

Yes

Input example 2

10

Output example 2

No

What you'll train

Cover the edge cases

What you get

  • Make boundary values explicit
  • Specify how to treat 1
  • Show how to handle negative numbers

How to ask the AI

Tell the AI how to judge cases like N=1, N=2, or negative numbers. Also state clearly that 1 is not a prime number, to prevent misjudgment.

If you ask vaguelyMistakenly judging 1 as a prime number, or implementing the logic without clearly handling numbers less than 2.

あなたのコード

実行しました

プレビュー

AIレビュー(プロンプト練習)

コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。

先にコードを実行し、テストを1つ以上通してください。