結果

問題 No.939 and or
ユーザー a01sa01to
提出日時 2025-08-21 00:34:34
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 543 bytes
コンパイル時間 2,955 ms
コンパイル使用メモリ 275,412 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-08-21 00:34:38
合計ジャッジ時間 4,213 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  ll a, b;
  cin >> a >> b;
  int ans = 1;
  bool flg = false;
  rep(i, 60) {
    int x = (a >> i) & 1;
    int y = (b >> i) & 1;
    if (x == 0 && y == 0) ans *= 1;
    if (x == 0 && y == 1) ans *= flg ? 2 : 1, flg = true;
    if (x == 1 && y == 0) ans *= 0;
    if (x == 1 && y == 1) ans *= 1;
  }
  cout << ans << '\n';
  return 0;
}
0