問題一覧 > 通常問題

No.4 Weights and a Balance

レベル : / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 963
作問者 : yuki2006
お気に入りにしたユーザー ProblemId : 19 / 自分の提出
問題文最終更新日: 2022-05-19 15:58:11
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 4 (順位表) の他の問題:

Problem Statement

Dave, who plays around even during class,
apparently became curious during a science experiment about whether, using all of the weights of various kinds of mass,
there is a combination of weights that makes the balance exactly level, and he is completely absorbed in this.
(All of the weights must be used, so none may be left over.)

Tell Dave whether such a combination exists, so that he can concentrate on the class.

If such a combination exists, output \(possible\); otherwise, output \(impossible\).

Input

\(N\)
\(W_1\ W_2\ W_3 \dots W_N\)

Line \(1\) contains an integer \( N\ ( 2 \leq N \leq 100) \), the number of weights.
Line \(2\) contains space-separated integers \( W_i\ ( 1 \leq W_i \leq 100) \), the mass of each weight.
\(W_i\) and \(W_j\) may have the same value.

Output

Output possible or impossible on one line.
Print a newline at the end.

Sample

Sample 1
Input
3
1 2 3
Output
possible

Placing \(1\) and \(2\) on the left side and \(3\) on the right side makes the balance level.

Sample 2
Input
5
1 2 3 4 5
Output
impossible

No combination using all of the weights makes the balance level, so tell Dave quickly, or the class will end.

Sample 3
Input
15
62 8 90 2 24 62 38 64 76 60 30 76 80 74 72
Output
impossible

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