結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー Carpenters-CatCarpenters-Cat
提出日時 2021-10-29 22:30:21
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 991 bytes
コンパイル時間 2,168 ms
コンパイル使用メモリ 195,852 KB
実行使用メモリ 18,944 KB
最終ジャッジ日時 2024-04-16 15:20:00
合計ジャッジ時間 4,349 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 13 ms
18,944 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 25 ms
18,944 KB
testcase_04 AC 32 ms
18,816 KB
testcase_05 AC 27 ms
18,816 KB
testcase_06 AC 31 ms
18,816 KB
testcase_07 AC 28 ms
18,944 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 29 ms
18,816 KB
testcase_10 AC 32 ms
18,816 KB
testcase_11 AC 30 ms
18,816 KB
testcase_12 AC 35 ms
18,816 KB
testcase_13 AC 36 ms
18,816 KB
testcase_14 AC 19 ms
18,816 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 31 ms
18,816 KB
testcase_18 AC 32 ms
18,944 KB
testcase_19 AC 27 ms
18,944 KB
testcase_20 AC 25 ms
18,816 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 29 ms
18,816 KB
testcase_23 AC 31 ms
18,816 KB
testcase_24 AC 28 ms
18,816 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 30 ms
18,944 KB
testcase_27 AC 2 ms
5,376 KB
testcase_28 AC 31 ms
18,816 KB
testcase_29 AC 31 ms
18,816 KB
testcase_30 AC 33 ms
18,816 KB
testcase_31 AC 31 ms
18,816 KB
testcase_32 AC 31 ms
18,816 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 2 ms
5,376 KB
testcase_35 AC 34 ms
18,944 KB
testcase_36 AC 2 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
testcase_39 AC 2 ms
5,376 KB
testcase_40 AC 25 ms
18,944 KB
testcase_41 AC 14 ms
18,944 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 13 ms
18,816 KB
testcase_45 WA -
testcase_46 AC 29 ms
18,816 KB
testcase_47 AC 30 ms
18,816 KB
testcase_48 WA -
testcase_49 AC 21 ms
18,816 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 and a < b) {
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;
}
0