結果
| 問題 |
No.939 and or
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-14 18:17:22 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 485 bytes |
| コンパイル時間 | 2,478 ms |
| コンパイル使用メモリ | 193,228 KB |
| 最終ジャッジ日時 | 2025-01-09 18:49:03 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
long a,b,cur,i,ans;
cin >> a >> b;
cur=0;
if(a>b){
cout << 0 << endl; return 0;
}
for(i=0; (1l<<i)<=b; i++){
if(((1l<<i) & a)&& !((1l<<i) & b)){
cout << 0 << endl; return 0;
}
if((1l<<i) & b-a){
cur++;
}
}
if(cur==0){
cout << 0 << endl;
}else{
ans=1;
for(i=1; i<cur; i++){
ans*=2;
}
cout << ans << endl;
}
return 0;
}