結果
| 問題 |
No.1723 [Cherry 3rd Tune *] Dead on
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-10-29 22:41:24 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 44 ms / 2,000 ms |
| コード長 | 1,031 bytes |
| コンパイル時間 | 944 ms |
| コンパイル使用メモリ | 72,172 KB |
| 最終ジャッジ日時 | 2025-01-25 09:16:20 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 50 |
ソースコード
#include <iostream>
#include <vector>
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 < 1000000; i++) {
while (x % i == 0) {
x /= i;
cnt_x[i]++;
}
}
for (long long i = 2; i < 1000000; 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;
//cout << i << endl;
return 0;
}
}
if (y != 1 && a < b) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
}