結果

問題 No.1250 汝は倍数なりや?
ユーザー 東前頭十一枚目
提出日時 2020-10-10 00:32:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 92 ms / 1,000 ms
コード長 238 bytes
コンパイル時間 1,793 ms
コンパイル使用メモリ 191,292 KB
最終ジャッジ日時 2025-01-15 06:04:27
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 49
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n; cin >> n;
	int64_t h; cin >> h;
	int64_t ans = 1;
	while(n--) {
		int64_t a; cin >> a;
		ans = (ans * a) % h;
	}
	cout << (ans == 0 ? "YES" : "NO") << '\n';
	return 0;
}
0