結果
| 問題 | No.683 Two Operations No.3 | 
| コンテスト | |
| ユーザー |  beet | 
| 提出日時 | 2018-05-11 22:28:08 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 415 bytes | 
| コンパイル時間 | 1,704 ms | 
| コンパイル使用メモリ | 173,652 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-28 09:53:43 | 
| 合計ジャッジ時間 | 2,264 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 16 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  Int a,b;
  cin>>a>>b;
  using P = pair<Int, Int>;
  queue<P> q;
  q.emplace(a,b);
  while(!q.empty()){
    tie(a,b)=q.front();q.pop();
    if(a==0||b==0){
      cout<<"Yes"<<endl;
      return 0;
    }
    if(a%2==0) q.emplace(a/2,b-1);
    if(b%2==0) q.emplace(a-1,b/2);
  }
  cout<<"No"<<endl;
  return 0;
}
            
            
            
        