結果
| 問題 | No.683 Two Operations No.3 | 
| コンテスト | |
| ユーザー |  xxxasdfghjk | 
| 提出日時 | 2018-08-13 14:41:26 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 846 bytes | 
| コンパイル時間 | 627 ms | 
| コンパイル使用メモリ | 72,064 KB | 
| 実行使用メモリ | 13,884 KB | 
| 最終ジャッジ日時 | 2024-09-24 08:00:48 | 
| 合計ジャッジ時間 | 4,316 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 4 WA * 2 TLE * 1 -- * 9 | 
ソースコード
#include<cstdio>
#include<queue>
#include<utility>
#include<cstring>
#include<stack>
#include<algorithm>
#include<cmath>
#include<iostream>
#include<map>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
bool solve(ll A,ll B){
  
  if(A == 0 && B == 0)
    return true;
  else if(A % 2 == 1 && B % 2 == 1)
    return false;
  else{
    if(A % 2 == 0 && B % 2 == 0){
      return solve(A/2,B-1);// || solve(A-1,B/2);
    }else{
      if(A % 2 == 1)
        return solve(A-1,B/2);
      else
        return solve(A/2,B-1);
    }
  }
  
}
int main()
{
  ll A,B;
  cin >> A >> B;
  if(B > A)
    swap(A,B);
  if(solve(A,B)){
    cout << "Yes" << endl;
  }else
    cout << "No" << endl;
  return 0;
}
            
            
            
        