結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー shisidor
提出日時 2023-04-01 17:36:23
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 689 bytes
コンパイル時間 738 ms
コンパイル使用メモリ 76,044 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-24 11:08:41
合計ジャッジ時間 3,080 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 49 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<map>
using namespace std;

int main() {
    long long x, y, a, b;
    cin >> x >> a >> y >> b;
    map<int, int> mpa;
    map<int, int> mpb;
    for (int i = 2; i < 1000000; i++) {
        while(x % i == 0) {
            x /= i;
            mpa[i]++;
        }
        if (x == 1) break;
    }
    for (int i = 2; i < 1000000; i++) {
        while(y % i == 0) {
            y /= i;
            mpb[i]++;
        }
        if (y == 1) break;
    }
    bool res = true;
    for (auto p : mpb) {
        if ((long long)a * mpa[p.first] < (long long)b * p.second) res = false;
    }
    if (res) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}
0