結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー Nzt3
提出日時 2022-09-28 12:14:15
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 511 bytes
コンパイル時間 1,924 ms
コンパイル使用メモリ 198,848 KB
最終ジャッジ日時 2025-02-07 17:48:54
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long A,B,X,Y;
  cin>>X>>A>>Y>>B;
  map<long long,long long>Xd,Yd;
  for(long long i=2;i*i<=X;i++){
    while(X%i==0){
      ++Xd[i];
      X/=i;
    }
  }
  if(X!=1)Xd[X]=1;
  for(long long i=2;i*i<=Y;i++){
    while(Y%i==0){
      ++Yd[i];
      Y/=i;
    }
  }
  if(Y!=1)Yd[Y]=1;
  bool ans=true;
  for(auto i:Yd){
    if(Xd[i.first]*A<i.second*B)ans=false;
  }
  cout<<(ans?"Yes\n":"No\n");
}
0