問題一覧 > 通常問題

No.1395 Less Sweet Alchemy

レベル : / AI推定難易度 : 147 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 234
作問者 : evima / テスター : 夕叢霧香(ゆうむらきりか) iaNTU
お気に入りにしたユーザー ProblemId : 5882 / 自分の提出
問題文最終更新日: 2021-02-28 20:33:28
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
バレンタインコンテスト2021 (順位表) の他の問題:

Problem Statement

Runrun likes chocolate with a cacao content of $X$ %.
You have a sufficient amount of each chocolate with cacao contents $C_1$ %, $\ldots$, $C_N$ %.
Determine whether it is possible to make chocolate with a cacao content of $X$ % by mixing appropriate amounts of these.

Formal statement: Determine whether there exists a sequence of non-negative real numbers $a_1, \ldots, a_N$ satisfying the following expression (★).
(★) $\sum_{i=1}^{N} C_i a_i = X \sum_{i=1}^{N} a_i > 0$

Input

$N\ X$
$C_1\ C_2\ \cdots\ C_N$

  • $1 \leq N \leq 99$
  • $1 \leq X \leq 99$
  • $1 \leq C_1 < \ldots < C_N \leq 99$
  • All values in the input are integers.

Output

Print Yes if it is possible to make chocolate with a cacao content of $X$ %, and No otherwise, followed by a newline.

Sample

Sample 1
Input
3 75
50 60 95
Output
Yes

For example, mixing $100$ grams of $50$ % cacao chocolate, $100$ grams of $60$ % chocolate, and $200$ grams of $95$ % chocolate makes $400$ grams of $75$ % chocolate.

Sample 2
Input
1 99
1
Output
No

This seems to be some other substance rather than chocolate.

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