結果

問題 No.939 and or
ユーザー ku_senjan
提出日時 2023-06-04 10:55:14
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 301 bytes
コンパイル時間 1,567 ms
コンパイル使用メモリ 168,204 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-29 03:26:49
合計ジャッジ時間 2,843 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

  ll ans = 1;
  for(int dgt=0; dgt<32; dgt++){
    ll msk = 1LL<<dgt;
    bool a = A&msk, b = B&msk;
    if(a && !b) ans = 0;
    if(!a && b) ans *= 2;
  }
  ans /= 2;
  cout << ans << endl;
}
0