結果

問題 No.939 and or
ユーザー iqueue02
提出日時 2019-12-02 16:15:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 1,573 ms
コンパイル使用メモリ 166,296 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-24 07:25:54
合計ジャッジ時間 2,666 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;

int main(){
  ll a, b;
  cin >> a >> b;
  ll res = 1;
  for (int i = 0; i < 31; i++) {
    int bit1 = (a & (1 << i)), bit2 = (b & (1 << i));
    if (bit1 && !bit2) res *= 0;
    if (!bit1 && bit2) res *= 2; 
  }
  cout << res/2 << endl;
  return 0;
}
0