結果
問題 |
No.939 and or
|
ユーザー |
![]() |
提出日時 | 2019-12-02 01:40:59 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 678 bytes |
コンパイル時間 | 1,306 ms |
コンパイル使用メモリ | 158,076 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 02:12:19 |
合計ジャッジ時間 | 5,219 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 RE * 1 |
other | AC * 10 RE * 20 |
ソースコード
#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() { ll a, b; cin >> a >> b; if ((a | b) != b) { cout << 0 << endl; return 0; } if (a == b) { cout << 1 << endl; return 0; } vector<int> error; error[0] = 1; cout << pow(2LL, max(0, bitpopcount(a^b) - 1)) << endl; return 0; }