結果

問題 No.1250 汝は倍数なりや?
ユーザー Noboru2020Noboru2020
提出日時 2020-10-09 21:41:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 74 ms / 1,000 ms
コード長 409 bytes
コンパイル時間 1,764 ms
コンパイル使用メモリ 168,072 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-20 10:06:59
合計ジャッジ時間 3,432 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 49
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
  int N,H,ans = 1;
  cin >> N >> H;
  vector<int>vec(N);
  for(int i=0; i<N; i++){
      cin >> vec[i]; 
      ans *= (vec[i]%H);
      ans %= H;
      if(ans == 0){
          cout << "YES" << endl;
          return 0;
      }
  }
  if(ans %H == 0){
      cout << "YES" << endl;
      return 0;
  }
  cout << "NO" << endl;
}
0