結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー tassei903tassei903
提出日時 2021-10-29 22:25:40
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,905 bytes
コンパイル時間 968 ms
コンパイル使用メモリ 93,852 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-04-16 15:15:49
合計ジャッジ時間 4,443 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,756 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <set>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
using ll = long long;
using ull = unsigned long long;

#define rep(i,n) for(long long i = 0; i < (int)n; i++)

#define FOR(i, m, n) for(long long i = (m);i < (n); ++i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SPEED cin.tie(0);ios::sync_with_stdio(false);

template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQR = priority_queue<T,vector<T>,greater<T>>;


void print(V<ll> ar) {
    for(auto x: ar)cout << x << " " ;
    cout << endl;
}

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

ll mpow(ll x, ll n, ll p) {
    ll r = 1;
    while (n>0) {
        if (n%2) {
            r*=x;
            r%=p;
        }
        x *= x;
        x %= p;
        n/=2;
    }
    return r;
}
const ll mod = 998244353;

V<P<ll,int>> facts(ll n) {
    V<P<ll,int>> res;
    if (n==1)return res;

    for(int x = 2; x*x<=n; x++) {
        if (n%x==0) {
            int p = 0;
            while (n%x==0) {
                p+=1;
                n/=x;
            }
            res.emplace_back(P<ll,int>(x, p));
        }
    }
    if (n!=1) {
        res.emplace_back(P<ll,int>(n, 1));
    }
    return res;
}


int main()
{
    ll x, y, a, b;
    cin >> x >> a >> y >> b;
    V<P<ll, int>> d1 = facts(x), d2 = facts(y);
    map<ll,int> mp;
    for(auto i : d1) {
        ll c = i.first;
        int d = i.second;
        mp[c] = d;
        //print({c,d});
    }
    for(auto i : d2) {
        ll c = i.first;
        int d = i.second;
        //print({mp[c],c,d});
        if (mp[c]*a<d*b) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}
0