結果

問題 No.939 and or
ユーザー
提出日時 2020-10-18 06:18:12
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 651 bytes
コンパイル時間 685 ms
コンパイル使用メモリ 92,360 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-21 03:18:18
合計ジャッジ時間 1,819 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long a, b;
bitset<32> bit, bit1;
int main() {
	cin >> a >> b;
	bit = a, bit1 = b;
	long long ans = 1, co = 0;
	for (int i = 0; i < 32; i++) {
		if (bit[i] == 1 && bit1[i] == 0) {
			cout << "0" << endl;
			return 0;
		}
		if (bit[i] == 0 && bit1[i] == 1) {
			co++;
		}
	}
	for (int i = 0; i < co - 1; i++) {
		ans *= 2;
	}
	cout << ans << endl;
	return 0;
}
0