On the first line, integers N and S are given, separated by a half-width space. On the second line, N integers are given. If there exists a combination of two elements at different positions whose sum is exactly S, output Yes; otherwise, output No. Even elements with the same value can form a pair as long as they are at different positions.
Constraints
2 ≤ N ≤ 1000, 0 ≤ S ≤ 2000, 0 ≤ each element ≤ 1000
Input example 1
4 9
2 7 4 5Output example 1
YesInput example 2
3 10
1 2 3Output example 2
NoWhat you'll train
Cover the edge cases
What you get
How to ask the AI
Show a concrete numeric example such as N=4, S=9, and clearly tell the AI the rule that "even elements with the same value can be paired as long as they're at different positions." Don't forget to specify the output (No) when no pair is found.
If you ask vaguelyThe AI may mistakenly exclude elements with the same value from being paired together, or may allow an element to be paired with itself.
あなたのコード
プレビュー
AIレビュー(プロンプト練習)
コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。