結果
| 問題 | 
                            No.1723 [Cherry 3rd Tune *] Dead on
                             | 
                    
| コンテスト | |
| ユーザー | 
                             milanis48663220
                         | 
                    
| 提出日時 | 2021-10-29 21:31:56 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,532 bytes | 
| コンパイル時間 | 1,268 ms | 
| コンパイル使用メモリ | 122,392 KB | 
| 最終ジャッジ日時 | 2025-01-25 08:31:54 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 20 WA * 30 | 
ソースコード
#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;
}
            
            
            
        
            
milanis48663220