結果

問題 No.683 Two Operations No.3
ユーザー amtgjwamtgjw
提出日時 2018-05-22 22:21:14
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 849 bytes
コンパイル時間 1,825 ms
コンパイル使用メモリ 70,996 KB
実行使用メモリ 12,244 KB
最終ジャッジ日時 2023-09-11 01:23:34
合計ジャッジ時間 6,949 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <complex>

using namespace std;

#define REP(i,n)	for(int i=0;i<(n);++i)
#define REPS(i,s,t)	for(int i=(s);i<(t);++i)

#define INF 		2000000007
#define MOD			1000000007

#define MAX 		200005

typedef unsigned int 			uint;
typedef unsigned long long int	ull;
typedef long long int 			ll;

//int dp[MAX];


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


	while(A>0&&B>0){
		int cnt=0;
		if(!(A&0)){
			while(!(A&1)){cnt++;A/=2;}
			B-=cnt;
			if(B&1){
				B++;
				A*=2;
			}
		}
		//cout << A <<" " << B <<endl;
		cnt=0;
		if(!(B&0)){
			while(!(B&1)){cnt++;B/=2;}
			A-=cnt;
			if(A&1){
				A++;
				B*=2;
			}
		}
		//cout << A <<" " << B <<endl;
	}
	
	if(A==0 || B==0)
		cout << "Yes\n";
	else
		cout << "No\n";

	return 0;
}
0