結果
| 問題 | No.1250 汝は倍数なりや? |
| コンテスト | |
| ユーザー |
startcpp
|
| 提出日時 | 2020-10-09 22:02:25 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 1,000 ms |
| コード長 | 338 bytes |
| 記録 | |
| コンパイル時間 | 328 ms |
| コンパイル使用メモリ | 74,184 KB |
| 実行使用メモリ | 81,892 KB |
| 最終ジャッジ日時 | 2026-04-02 23:21:57 |
| 合計ジャッジ時間 | 2,008 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 49 |
ソースコード
#include <iostream>
#define int long long
using namespace std;
int n, h;
int a[200000];
signed main() {
int i;
cin >> n >> h;
for (i = 0; i < n; i++) cin >> a[i];
int ans = 1;
for (i = 0; i < n; i++) {
ans *= a[i];
ans = (ans % h + h) % h;
}
if (ans == 0) cout << "YES" << endl;
else cout << "NO" << endl;
return 0;
}
startcpp