結果

問題 No.939 and or
ユーザー coco18000
提出日時 2019-12-02 00:15:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 595 bytes
コンパイル時間 1,547 ms
コンパイル使用メモリ 166,292 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-21 23:51:04
合計ジャッジ時間 2,462 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

int main() {
    ll A, B;
    cin >> A >> B;
    ll n = 0;
    REP(i, 40) {
        ll a = (A >> i) & 1;
        ll b = (B >> i) & 1;

        if (a == 1 && b == 0) {
            cout << 0 << endl;
            return 0;
        }
        if (a != b)
            n++;
    }

    cout << pow(2, n - 1) << endl;
    return 0;
}
0