結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー Carpenters-CatCarpenters-Cat
提出日時 2021-10-29 22:41:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,029 bytes
コンパイル時間 741 ms
コンパイル使用メモリ 75,956 KB
実行使用メモリ 19,124 KB
最終ジャッジ日時 2024-04-16 15:30:06
合計ジャッジ時間 3,147 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
18,944 KB
testcase_01 WA -
testcase_02 AC 2 ms
5,376 KB
testcase_03 WA -
testcase_04 AC 29 ms
18,816 KB
testcase_05 AC 28 ms
18,812 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 32 ms
18,944 KB
testcase_10 WA -
testcase_11 AC 30 ms
19,072 KB
testcase_12 WA -
testcase_13 AC 31 ms
18,996 KB
testcase_14 WA -
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 31 ms
18,936 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
5,376 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 32 ms
18,876 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 WA -
testcase_27 AC 2 ms
5,376 KB
testcase_28 AC 30 ms
18,944 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 32 ms
18,816 KB
testcase_32 WA -
testcase_33 AC 1 ms
5,376 KB
testcase_34 AC 2 ms
5,376 KB
testcase_35 WA -
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 WA -
testcase_41 WA -
testcase_42 AC 30 ms
18,984 KB
testcase_43 AC 30 ms
18,944 KB
testcase_44 WA -
testcase_45 AC 30 ms
18,944 KB
testcase_46 AC 31 ms
18,900 KB
testcase_47 WA -
testcase_48 AC 30 ms
18,816 KB
testcase_49 AC 30 ms
18,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
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 < 1000000; i++) {
        while (x % i == 0) {
            x /= i;
            cnt_x[i]++;
        }
    }
    for (long long i = 2; i < 1000000; 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;
            cout << i << endl;
            return 0;
        }
    }
    if (y != 1 && a < b) {
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;
}
0