結果

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

ソースコード

diff #

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

int main() {
    ll a,b;
    std::cin >> a>>b;
    
    ll res = 0;
    for (int i = 0; i < 32; i++) {
        if( (a & (1<<i) ) && !(b & (1<<i) ) ){
            std::cout << 0 << std::endl;
            return 0;
        } 
        if( (a & (1<<i) ) ^ (b & (1<<i) ) ) {
            res++;
            // std::cout << i << std::endl;
        }
    }
    
    std::cout << pow(2,res) << std::endl;
}


// 0011000000111001
// 1101010000110001 
0