結果
問題 |
No.939 and or
|
ユーザー |
![]() |
提出日時 | 2019-12-02 01:25:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 564 bytes |
コンパイル時間 | 1,394 ms |
コンパイル使用メモリ | 158,600 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-22 01:50:28 |
合計ジャッジ時間 | 2,673 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 WA * 1 |
ソースコード
#include "bits/stdc++.h" #define REP(i, n) for(int i = 0; i < int(n); i++) #define FOR(i,n,m) for(int i = int(n); i < int(m); i++) using namespace std; typedef long long ll; const int MOD = 1e9 + 7; const int INF = 1e9 + 6; const ll LLINF = 1e18 + 1; int bitpopcount(ll n) { int res = 0; while (n) { if (n & 1) res++; n >>= 1; } return res; } int main() { int a, b; cin >> a >> b; if ((a | b) != b) { cout << 0 << endl; return 0; } cout << pow(2, max(0,bitpopcount(a^b)-1)) << endl; return 0; }