結果

問題 No.939 and or
ユーザー eve__fuyuki
提出日時 2019-12-24 02:12:51
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 1,506 ms
コンパイル使用メモリ 157,720 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-19 06:33:44
合計ジャッジ時間 2,355 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 6 WA * 24
権限があれば一括ダウンロードができます

ソースコード

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;
			}
		}
	}
  if (a != 0) {
	  ans /= 2;
	}
  cout << ans << endl;
  return 0;
}
0