結果

問題 No.939 and or
ユーザー tekihei2317
提出日時 2019-12-10 21:37:06
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 305 bytes
コンパイル時間 1,684 ms
コンパイル使用メモリ 167,708 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-24 02:24:41
合計ジャッジ時間 3,082 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
	int A,B; cin>>A>>B;
	int cnt=0;
	for(int i=0;i<31;i++){
		int a=A>>i&1;
		int b=B>>i&1;
		if(a==1 and b==0){
			cout<<0<<endl;
			return 0;
		}
		if(a==0 and b==1) cnt++;
	}
	if(cnt==0) cout<<1<<endl;
	else cout<<(1<<(cnt-1))<<endl;
	return 0;
}
0