結果

問題 No.2682 Visible Divisible
ユーザー daiotadaiota
提出日時 2024-03-20 23:28:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 567 bytes
コンパイル時間 1,648 ms
コンパイル使用メモリ 169,064 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2024-03-20 23:28:43
合計ジャッジ時間 3,741 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
6,548 KB
testcase_01 AC 39 ms
6,548 KB
testcase_02 AC 39 ms
6,548 KB
testcase_03 AC 40 ms
6,548 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 37 ms
6,548 KB
testcase_08 WA -
testcase_09 AC 2 ms
6,548 KB
testcase_10 AC 2 ms
6,548 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 38 ms
6,548 KB
testcase_14 WA -
testcase_15 AC 38 ms
6,548 KB
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
#define REP(i,n) for(int i=0;i<int(n);i++)




ll gcd(ll a,ll b){
	if(b==0) return a;
	else return gcd(b,a%b);
}


ll lcm(ll a,ll b){
	return a/gcd(a,b)*b;
}



int main(){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
    int i,j,k;


    int N;
    ll K;
    cin >> N >> K;
    vector<ll> A(N);
    for(i=0;i<N;i++){
    	cin >> A[i];
    	ll x=gcd(A[i],K);
    	K%=x;
    }


    if(K==1) cout << "Yes" << endl;
    else cout << "No" << endl;




	return 0;

}
0