結果

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

ソースコード

diff #

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

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int a, b;
  cin >> a >> b;
  long long res = 1;
  for (int k = 0; k < 31; ++k) {
    int crr = 1 + ((a >> k & 1) != (b >> k & 1));
    res *= crr;
  }
  res -= a == b;
  res /= 2;
  cout << res << '\n';
}
0