結果
| 問題 |
No.939 and or
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-05 19:30:27 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 313 bytes |
| コンパイル時間 | 2,398 ms |
| コンパイル使用メモリ | 192,384 KB |
| 最終ジャッジ日時 | 2025-01-10 06:59:02 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using lint=long long;
int main(){
lint a,b; cin>>a>>b;
if((a&b)!=a) return puts("0"),0;
if(a==b) return puts("1"),0;
lint ans=1;
rep(i,32) if((a>>i&1)==0 && (b>>i&1)!=0) ans*=2;
printf("%lld\n",ans/2);
return 0;
}