結果

問題 No.939 and or
ユーザー algon_320algon_320
提出日時 2019-12-03 00:02:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 397 bytes
コンパイル時間 1,502 ms
コンパイル使用メモリ 167,220 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-25 01:59:52
合計ジャッジ時間 2,140 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
    int A, B;
    cin >> A >> B;
    bitset<32> a(A), b(B);
    int ans = 1;
    for (int k = 0; k < 32; k++) {
        if (a[k] && !b[k]) {
            cout << 0 << endl;
            return 0;
        }
        if (!a[k] && b[k]) {
            ans <<= 1;
        }
    }
    ans >>= 1;
    cout << ans << endl;
}
0