結果
| 問題 |
No.1723 [Cherry 3rd Tune *] Dead on
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-10-29 21:47:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 23 ms / 2,000 ms |
| コード長 | 796 bytes |
| コンパイル時間 | 2,013 ms |
| コンパイル使用メモリ | 173,392 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-07 10:48:30 |
| 合計ジャッジ時間 | 3,367 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 50 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, l, r) for (int i = (l); i < (r); i++)
using namespace std;
typedef long long ll;
map<ll, int> pf(ll x) {
map<ll, int> ret;
for (ll i = 2; i * i <= x; i++) {
int y = 0;
while (x % i == 0) {
y++;
x /= i;
}
if (y > 0) ret[i] = y;
}
if (x > 1) ret[x]++;
return ret;
}
int main() {
ll X, A, Y, B;
cin >> X >> A >> Y >> B;
auto C = pf(X), D = pf(Y);
string ans = "Yes\n";
//for (auto i : C) cout << i.first << " " << i.second << endl;
//for (auto i : D) cout << i.first << " " << i.second << endl;
for (auto i : D) {
if (B * i.second > A * C[i.first]) ans = "No\n";
//cout << i.second << " " << C[i.first] << endl;
}
cout << ans;
}