No.1250 Art Thou a Multiple?
問題文最終更新日: 2020-10-02 23:53:12
English (AI translation)
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 269 (MATHEMATICS 1)
(順位表)
の他の問題:
Problem Statement
Determine whether the product $A_1 \times \dots \times A_N$ of $N$ integers $A_1,\dots,A_N$ is a multiple of $H$.
Constraints
- $1 \leq N \leq 2 \times 10^5$
- $1 \leq H \leq 10^9$
- $|A_i| \leq 10^9$
- All input values are integers.
Input
The input is given from standard input in the following format.$N~H$ $A_1~\dots~A_N$
Output
If the product $A_1 \times \dots \times A_N$ is a multiple of $H$, print YES; if it is not a multiple of $H$, print NO.
Sample
Sample 1
Input
3 3 1 2 3
Output
YES
$1 \times 2 \times 3=6$ is a multiple of $3$.
Sample 2
Input
1 5 4
Output
NO
$4$ is not a multiple of $5$.
Sample 3
Input
6 6 6 6 6 6 6 6
Output
YES
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
Kazun
QCFium