結果
| 問題 | No.1723 [Cherry 3rd Tune *] Dead on |
| コンテスト | |
| ユーザー |
Today03
|
| 提出日時 | 2024-03-16 17:45:28 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 779 bytes |
| 記録 | |
| コンパイル時間 | 1,724 ms |
| コンパイル使用メモリ | 216,656 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-04 03:07:03 |
| 合計ジャッジ時間 | 3,223 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 50 |
ソースコード
#include <bits/stdc++.h>
#ifdef LOCAL
#include "./debug.cpp"
#else
#define debug(...)
#define print_line
#endif
using namespace std;
using ll = long long;
void calc(ll X, ll A, map<ll, ll>& mp) {
ll nX = X;
for (ll i = 2; i * i <= nX; i++) {
if (X % i != 0) {
continue;
}
ll res = 0;
while (X % i == 0) {
X /= i;
res++;
}
res *= A;
mp[i] = res;
}
if (X != 1) {
mp[X] = A;
}
}
int main() {
ll X, Y, A, B;
cin >> X >> A >> Y >> B;
map<ll, ll> mp1, mp2;
calc(X, A, mp1);
calc(Y, B, mp2);
bool ans = true;
for (auto [k, v] : mp2) {
if (mp1[k] < v) {
ans = false;
}
}
puts(ans ? "Yes" : "No");
}
Today03