結果

問題 No.3150 count X which satisfies with equlation
ユーザー れいん
提出日時 2025-07-22 13:34:33
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 2,952 ms
コンパイル使用メモリ 275,256 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-07-22 13:34:38
合計ジャッジ時間 4,894 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 42
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
    int A, B;
    cin >> A >> B;
    int N = 255;
    long long ans = 1;
    for (int bit = 0; bit <= 8; bit++)
    {
        int A_bit = (A >> bit) & 1;
        int B_bit = (B >> bit) & 1;
        if (A_bit == 1 && B_bit == 0)
        {
            ans *= 0;
        }
        if (A_bit == 1 && B_bit == 1)
        {
            ans *= 2;
        }
    }
    cout << ans;
}
0