結果

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

ソースコード

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 << floor(pow(2,res-1)) << std::endl;
}


// 0011000000111001
// 1101010000110001 
0