結果
問題 |
No.1250 汝は倍数なりや?
|
ユーザー |
![]() |
提出日時 | 2020-10-09 22:01:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 313 bytes |
コンパイル時間 | 616 ms |
コンパイル使用メモリ | 63,104 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-20 11:20:47 |
合計ジャッジ時間 | 2,673 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 41 WA * 8 |
ソースコード
#include <iostream> using namespace std; int n, h; int a[200000]; int 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; }