結果
| 問題 |
No.1250 汝は倍数なりや?
|
| コンテスト | |
| ユーザー |
startcpp
|
| 提出日時 | 2020-10-09 22:02:25 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 78 ms / 1,000 ms |
| コード長 | 338 bytes |
| コンパイル時間 | 587 ms |
| コンパイル使用メモリ | 64,364 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-20 11:21:48 |
| 合計ジャッジ時間 | 2,611 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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