結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ll A, B;
    cin >> A >> B;
    ll t = 1;
    ll ans = 1;
    for (int i = 0; i < 31; i++) {
        ll u = A & t;
        ll v = B & t;
        if (u != 0 && v == 0) {
            cout << 0 << "\n";
            return 0;
        } else if (u == 0 && v == 1) {
            ans *= 2;
        }
        t *= 2;
    }
    cout << ans << "\n";
    return 0;
}
0