結果
| 問題 | 
                            No.1723 [Cherry 3rd Tune *] Dead on
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-10-29 22:30:21 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 991 bytes | 
| コンパイル時間 | 2,274 ms | 
| コンパイル使用メモリ | 195,148 KB | 
| 最終ジャッジ日時 | 2025-01-25 09:11:18 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 45 WA * 5 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main () {
    long long x, y, a, b;
    cin >> x >> a >> y >> b;
    if (y == 1) {
        cout << "Yes" << endl;
        return 0;
    }
    if (x == y && a >= b) {
        cout << "Yes" << endl;
        return 0;
    }
    long long x_ = x;
    long long y_ = y;
    vector<long long> cnt_x(1000000, 0), cnt_y(1000000, 0);
    for (long long i = 2; i * i <= x_; i ++) {
        while (x % i == 0) {
            x /= i;
            cnt_x[i] ++;
        }
    }
    for (long long i = 2; i * i <= y_; i ++) {
        while (y % i == 0) {
            y /= i;
            cnt_y[i] ++;
        }
    }
    if (x % y != 0) {
        cout << "No" << endl;
        return 0;
    }
    for (int i = 2; i < 1000000; i ++) {
        if (cnt_x[i] * a < cnt_y[i] * b) {
            cout << "No" << endl;
            return 0;
        }
    }
    if (y != 1 and a < b) {
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;
}