結果

問題 No.939 and or
ユーザー eve__fuyuki
提出日時 2019-12-24 02:13:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 2,125 ms
コンパイル使用メモリ 157,532 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 06:34:16
合計ジャッジ時間 2,469 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll a, b;
  cin >> a >> b;
  ll ans   = 1;
  bool flg = false;
  for (ll i = 1; i < (1LL << 31); i = i << 1) {
	  ll A = i & a;
	  ll B = i & b;
	  if (A > B) {
		  ans = 0;
		  break;
		}
	  if (A < B) {
		  if (!flg) {
			  flg = true;
			} else {
			  ans *= 2;
			}
		}
	}
  cout << ans << endl;
  return 0;
}
0