結果

問題 No.1250 汝は倍数なりや?
ユーザー TokuzooTokuzoo
提出日時 2022-02-25 21:22:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 670 bytes
コンパイル時間 1,922 ms
コンパイル使用メモリ 173,756 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-09-16 15:56:05
合計ジャッジ時間 5,764 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

void pb(map<int,int> &m, int x){ 
    int t = x;
    for(ll i=2; i*i<=t; i++){
        if(x % i == 0){
            x /= i;
            m[i]++;
        }

        if(x == 1) break;
    }

    if(x != 1) m[x]++;
}

int main(){
    int n,h;
    cin >> n >> h;

    map<int,int> hm;
    pb(hm, h);

    map<int,int> am;

    int t;

    for(int i=0; i<n; i++){
        cin >> t;
        pb(am, t);
    }

    for(auto e : hm){
        auto k = e.first;
        auto v = e.second;

        if(v > am[k]){
            cout << "NO" << endl;
            return 0;
        }
    }

    cout << "YES" << endl;
}
0