結果
問題 | No.1723 [Cherry 3rd Tune *] Dead on |
ユーザー |
![]() |
提出日時 | 2021-11-12 19:04:50 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 707 bytes |
コンパイル時間 | 2,198 ms |
コンパイル使用メモリ | 201,480 KB |
最終ジャッジ日時 | 2025-01-25 15:26:43 |
ジャッジサーバーID (参考情報) |
judge10 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 44 WA * 6 |
ソースコード
#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; } } cout << "Yes" << endl; return 0; }