結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー Carpenters-CatCarpenters-Cat
提出日時 2021-10-29 22:34:49
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 990 bytes
コンパイル時間 2,274 ms
コンパイル使用メモリ 197,100 KB
実行使用メモリ 19,120 KB
最終ジャッジ日時 2024-04-16 15:26:31
合計ジャッジ時間 4,457 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 7 ms
19,000 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 20 ms
18,816 KB
testcase_04 AC 27 ms
18,948 KB
testcase_05 AC 22 ms
18,944 KB
testcase_06 AC 24 ms
18,920 KB
testcase_07 AC 22 ms
18,924 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 24 ms
18,836 KB
testcase_10 AC 26 ms
18,880 KB
testcase_11 AC 24 ms
18,952 KB
testcase_12 AC 29 ms
18,948 KB
testcase_13 AC 30 ms
18,904 KB
testcase_14 AC 13 ms
18,928 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 25 ms
19,036 KB
testcase_18 AC 28 ms
18,976 KB
testcase_19 AC 21 ms
19,048 KB
testcase_20 AC 20 ms
18,916 KB
testcase_21 AC 2 ms
6,940 KB
testcase_22 AC 23 ms
18,916 KB
testcase_23 AC 26 ms
18,984 KB
testcase_24 AC 21 ms
18,936 KB
testcase_25 AC 2 ms
6,944 KB
testcase_26 AC 24 ms
19,000 KB
testcase_27 AC 2 ms
6,944 KB
testcase_28 AC 25 ms
18,816 KB
testcase_29 AC 25 ms
18,996 KB
testcase_30 AC 27 ms
18,904 KB
testcase_31 AC 24 ms
18,880 KB
testcase_32 AC 25 ms
19,000 KB
testcase_33 AC 2 ms
6,940 KB
testcase_34 AC 2 ms
6,944 KB
testcase_35 AC 29 ms
18,916 KB
testcase_36 AC 2 ms
6,944 KB
testcase_37 AC 2 ms
6,944 KB
testcase_38 AC 1 ms
6,940 KB
testcase_39 AC 2 ms
6,940 KB
testcase_40 AC 18 ms
18,816 KB
testcase_41 AC 7 ms
18,904 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 8 ms
18,980 KB
testcase_45 WA -
testcase_46 AC 23 ms
18,812 KB
testcase_47 AC 24 ms
18,832 KB
testcase_48 WA -
testcase_49 AC 16 ms
18,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 && a < b) {
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;
}
0