結果
問題 |
No.1250 汝は倍数なりや?
|
ユーザー |
|
提出日時 | 2020-10-10 00:14:01 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 28 ms / 1,000 ms |
コード長 | 377 bytes |
コンパイル時間 | 2,541 ms |
コンパイル使用メモリ | 193,120 KB |
最終ジャッジ日時 | 2025-01-15 06:01:46 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 49 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, ss, ee) for (int i = ss; i < ee; ++i) void solve() { ll N, H; cin >> N >> H; ll sum = 1LL; rep(i, 0, N) { ll a; cin >> a; sum = (sum * a) % H; } cout << ((sum % H == 0LL) ? "YES" : "NO") << endl; } int main() { ios::sync_with_stdio(false); cin.tie(0); solve(); }