結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー houren
提出日時 2021-10-29 21:36:51
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 670 bytes
コンパイル時間 1,920 ms
コンパイル使用メモリ 167,700 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-07 10:22:38
合計ジャッジ時間 3,837 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
using P = pair<int,int>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()

int main(){
    ll x,a,b,y;
    cin >> x >> a >> y >> b;
    for(int i=2;i<=1000000;i++){
        int cnt1 = 0, cnt2 = 0;
        while(!(x%i)){
            cnt1++;
            x /= i;
        }
        while(!(y%i)){
            cnt2++;
            y /= i;
        }
        if(cnt1*a<cnt2*b){
            cout << "No" << endl;
            return 0;
        }
    }
    if(y==1 || (x==y && a>=b)) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}
0