結果

問題 No.1250 汝は倍数なりや?
ユーザー shiomusubi496shiomusubi496
提出日時 2020-10-09 21:50:07
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 541 bytes
コンパイル時間 1,540 ms
コンパイル使用メモリ 173,464 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-27 16:23:00
合計ジャッジ時間 7,667 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 2 ms
4,376 KB
testcase_02 RE -
testcase_03 AC 1 ms
4,376 KB
testcase_04 RE -
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 RE -
testcase_12 AC 2 ms
4,380 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 1 ms
4,376 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 2 ms
4,380 KB
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 AC 38 ms
4,380 KB
testcase_38 AC 41 ms
4,380 KB
testcase_39 RE -
testcase_40 RE -
testcase_41 AC 48 ms
4,376 KB
testcase_42 RE -
testcase_43 AC 65 ms
4,380 KB
testcase_44 AC 26 ms
4,380 KB
testcase_45 RE -
testcase_46 RE -
testcase_47 RE -
testcase_48 AC 2 ms
4,376 KB
testcase_49 AC 1 ms
4,380 KB
testcase_50 RE -
testcase_51 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
    int N,H;
    cin>>N>>H;
    map<int,int> mp;
    for(int i=2;i*i<=H;i++){
        for(;H%i==0;H/=i)mp[i]++;
    }
    if(H!=1)mp[H]++;
    while(N--){
        int a;
        cin>>a;
        if(!a){
            puts("YES");
            return 0;
        }
        for(pair<int,int> p:mp){
            for(;a%p.first==0 && mp[p.first];a/=p.first)mp[p.first]--;
            if(!mp[p.first])mp.erase(p.first);
        }
    }
    puts(mp.size()?"NO":"YES");
}
0