結果
| 問題 |
No.1723 [Cherry 3rd Tune *] Dead on
|
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2021-10-29 21:24:13 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 2,000 ms |
| コード長 | 651 bytes |
| コンパイル時間 | 2,338 ms |
| コンパイル使用メモリ | 198,404 KB |
| 最終ジャッジ日時 | 2025-01-25 08:22:36 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 50 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
#include<bits/stdc++.h>
using namespace std;
map<ll,ll> prime_factor(ll x){
map<ll,ll> res;
for(ll i=2;i*i<=x;i++){
while(x%i==0){
res[i]++;
x/=i;
}
}
if(x!=1) res[x]++;
return res;
}
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll x,y,a,b;
cin>>x>>a>>y>>b;
map<ll,ll> mx=prime_factor(x),my=prime_factor(y);
bool f=true;
for(auto t:my){
if(mx[t.first]*a<t.second*b) f=false;
}
if(f) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
}
umezo