結果

問題 No.1250 汝は倍数なりや?
ユーザー ui_mtc
提出日時 2020-10-09 23:56:18
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 1,573 ms
コンパイル使用メモリ 165,996 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-20 14:46:43
合計ジャッジ時間 3,907 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define int long long
#define double long double
using namespace std;
const int MOD =  1000000007;
const int INF = 1e11;
using Graph = vector<vector<int>>;

signed main(){
  int N, H;
  cin >> N >> H;

  bool fg = 0;
  int now = 1;
  for( int i = 0; i < N; i++ ){
    int A;
    cin >> A;
    if( A%H == 0 ) fg = 1;
    else now *= (A%H);
    if( now >= H ){
      if( now%H == 0 ) fg = 1;
      now %= H;
    }
  }
  if( fg ) cout << "YES" << endl;
  else cout << "NO" << endl;
}
0