結果
問題 |
No.683 Two Operations No.3
|
ユーザー |
![]() |
提出日時 | 2018-05-11 22:25:43 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 693 bytes |
コンパイル時間 | 1,801 ms |
コンパイル使用メモリ | 173,380 KB |
実行使用メモリ | 925,952 KB |
最終ジャッジ日時 | 2024-06-28 04:07:13 |
合計ジャッジ時間 | 8,003 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | MLE * 1 -- * 15 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int64_t a, b; cin >> a >> b; set<pair<int64_t, int64_t>> st; st.insert({0, 0}); while (!st.empty()) { set<pair<int64_t, int64_t>> next; for (auto &p : st) { if (p.first == a && p.second == b) { cout << "Yes" << endl; return 0; } if (a < p.first || b < p.second) { continue; } next.insert({2 * p.first, p.second + 1}); next.insert({p.first + 1, 2 * p.second}); } swap(st, next); } cout << "No" << endl; return 0; }