結果
| 問題 |
No.1723 [Cherry 3rd Tune *] Dead on
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-10-29 22:34:49 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 990 bytes |
| コンパイル時間 | 1,976 ms |
| コンパイル使用メモリ | 195,140 KB |
| 最終ジャッジ日時 | 2025-01-25 09:13:54 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 45 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main () {
long long x, y, a, b;
cin >> x >> a >> y >> b;
if (y == 1) {
cout << "Yes" << endl;
return 0;
}
if (x == y && a >= b) {
cout << "Yes" << endl;
return 0;
}
long long x_ = x;
long long y_ = y;
vector<long long> cnt_x(1000000, 0), cnt_y(1000000, 0);
for (long long i = 2; i * i <= x_; i ++) {
while (x % i == 0) {
x /= i;
cnt_x[i] ++;
}
}
for (long long i = 2; i * i <= y_; i ++) {
while (y % i == 0) {
y /= i;
cnt_y[i] ++;
}
}
if (x % y != 0) {
cout << "No" << endl;
return 0;
}
for (int i = 2; i < 1000000; i ++) {
if (cnt_x[i] * a < cnt_y[i] * b) {
cout << "No" << endl;
return 0;
}
}
if (y != 1 && a < b) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
}