結果
| 問題 |
No.1723 [Cherry 3rd Tune *] Dead on
|
| コンテスト | |
| ユーザー |
Example0911
|
| 提出日時 | 2021-11-12 19:05:53 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 2,000 ms |
| コード長 | 860 bytes |
| コンパイル時間 | 2,048 ms |
| コンパイル使用メモリ | 199,804 KB |
| 最終ジャッジ日時 | 2025-01-25 15:26:53 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 50 |
ソースコード
#include "bits/stdc++.h"
#define int long long
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll INF = (1LL << 61);
ll mod = 1000000007;
map<ll, ll> prime_factor(ll n) {
map<ll, ll> ret;
for (ll i = 2; i * i <= n; i++) {
while (n % i == 0) {
ret[i]++;
n /= i;
}
}
if (n != 1) ret[n] = 1;
return ret;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int X, A, Y, B; cin >> X >> A >> Y >> B;
map<int, int>mp, mp2;
mp = prime_factor(X);
mp2 = prime_factor(Y);
for (auto x : mp) {
int now = x.second; now *= A;
int now2 = mp2[x.first]; now2 *= B;
if (now < now2) {
cout << "No" << endl; return 0;
}
}
for (auto x : mp2) {
int now = x.second; now *= B;
int now2 = mp[x.first]; now2 *= A;
if (now > now2) {
cout << "No" << endl; return 0;
}
}
cout << "Yes" << endl;
return 0;
}
Example0911