結果

問題 No.2533 A⇒B問題
ユーザー Ywestbuilderk
提出日時 2023-11-10 22:45:37
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 515 bytes
コンパイル時間 681 ms
コンパイル使用メモリ 65,152 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-26 01:59:53
合計ジャッジ時間 1,470 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
using namespace std;
string c,d;
string dfs(int i,string s){
    if(i == 0) return s;
    while(i > 0){
    	if(i % 2 == 0) s.push_back('0');
    	else s.push_back('1');
    	i /= 2;
    }
    return s;
    
}
int main(){
	int a,b;
	bool A = 1;
	cin >> a >> b;
	c = "";
	d = "";
	string s = dfs(a,c);
	string t = dfs(b,d);
	for(int i  = 0; i < s.size();i++){
		if(s[i]){ 
			if(i  > t.size()) A = 0;
			else if(!t[i]) A = 0;
		}
	}
	if(A)  cout << "Yes";
	else cout  << "No";
	
}
0