結果

問題 No.683 Two Operations No.3
ユーザー どららどらら
提出日時 2018-05-12 00:24:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 667 bytes
コンパイル時間 1,352 ms
コンパイル使用メモリ 163,540 KB
実行使用メモリ 812,096 KB
最終ジャッジ日時 2023-09-10 18:06:37
合計ジャッジ時間 3,330 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 MLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

bool check(ll A, ll B){
  if(A == 0 && B == 0) return true;
  if(A < 0 || B < 0) return false;
  
  if(A%2==0 && B>0){
    if(check(A/2,B-1)) return true;
  }
  if(B%2==0 && A>0){
    if(check(A-1,B/2)) return true;
  }
  return false;
}

int main(){
  ll A, B;
  cin >> A >> B;

  if(check(A,B)) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}
0