結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー milanis48663220milanis48663220
提出日時 2021-10-29 21:31:56
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,532 bytes
コンパイル時間 1,398 ms
コンパイル使用メモリ 125,796 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 14:13:12
合計ジャッジ時間 3,245 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <cmath>
#include <numeric>
#include <functional>
#include <cassert>

#define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl;
#define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using namespace std;
typedef long long ll;

using P = pair<ll, ll>;

vector<P> factorize(ll x){
    ll y = x;
    vector<P> ans;
    for(ll n = 2; n*n <= x; n++){
        if(y%n == 0){
            ll cnt = 0;
            while(y%n == 0) {
                cnt++;
                y /= n;
            }
            ans.push_back(P(n, cnt));
        }
    }
    if(y != 1) ans.push_back(P(y, 1));
    return ans;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    ll x, a, y, b; cin >> x >> a >> y >> b;
    auto fx = factorize(x);
    auto fy = factorize(y);
    map<ll, ll> mp;
    for(auto [m, c]: fx) {
        mp[m] = c*b;
    }
    for(auto [m, c]: fy){
        if(mp.count(m) == 0){
            cout << "No" << endl;
            return 0;
        }
        if(c*a > mp[m]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}
0