結果
問題 |
No.1723 [Cherry 3rd Tune *] Dead on
|
ユーザー |
|
提出日時 | 2021-10-29 22:48:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 835 bytes |
コンパイル時間 | 1,559 ms |
コンパイル使用メモリ | 167,940 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-07 12:29:01 |
合計ジャッジ時間 | 3,020 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 43 WA * 7 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long X, A, Y, B, extra = 0; cin >> X >> A >> Y >> B; if(X % Y == 0) { if(A >= B) cout << "Yes" << endl; else { extra = B / A; if(B % A != 0) extra++; long long power = pow(Y, extra); if(power > 0 && power % Y == 0 && X % power == 0) cout << "Yes" << endl; else cout << "No" << endl; } } else { if(A >= B) { extra = A / B; long long power = pow(X, extra); if(power > 0 && power % X == 0 && power % Y == 0) cout << "Yes" << endl; else cout << "No" << endl; } else cout << "No" << endl; } return 0; }