結果

問題 No.939 and or
ユーザー れいん
提出日時 2025-06-02 14:32:23
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 479 bytes
コンパイル時間 3,403 ms
コンパイル使用メモリ 273,124 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-06-02 14:32:28
合計ジャッジ時間 4,873 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
    long long A, B;
    cin >> A >> B;
    if (A > B)
    {
        cout << 0;
        return 0;
    }
    int ans = 0;
    for (int i = 0; i < 32; i++)
    {
        int A_i = (A >> i) & 1;
        int B_i = (B >> i) & 1;
        if (A_i == 1 && B_i == 0)
        {
            cout << 0;
            return 0;
        }
        if (A_i == 0 && B_i == 1)
        {
            ans++;
        }
    }
    cout << ans;
}
0