結果

問題 No.2533 A⇒B問題
ユーザー twooimp2twooimp2
提出日時 2023-11-10 21:25:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 504 bytes
コンパイル時間 1,637 ms
コンパイル使用メモリ 168,808 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-11-10 21:25:11
合計ジャッジ時間 2,345 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 1 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 1 ms
6,676 KB
testcase_10 AC 1 ms
6,676 KB
testcase_11 AC 1 ms
6,676 KB
testcase_12 AC 1 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 1 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 AC 2 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 1 ms
6,676 KB
testcase_21 AC 2 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 1 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;

int main(){
  ll a,b;
  cin>>a>>b;
  string ba,bb;
  while(a){
    ll r=a%2;
    ba+=r+'0';
    a/=2;
  }
  while(b){
    ll r=b%2;
    bb+=r+'0';
    b/=2;
  }
  while(ba.size()!=50){
    ba+=0+'0';
  }
  while(bb.size()!=50){
    bb+=0+'0';
  }
  reverse(ba.begin(),ba.end());
  reverse(bb.begin(),bb.end());
  for(ll i=0;i<50;i++){
    if(ba[i]=='1'&&bb[i]!='1'){
      cout<<"No"<<endl;
      exit(0);
    }
  }
  cout<<"Yes"<<endl;
}
0