結果
問題 | No.939 and or |
ユーザー |
![]() |
提出日時 | 2019-12-02 00:19:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 656 bytes |
コンパイル時間 | 1,501 ms |
コンパイル使用メモリ | 165,972 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 23:54:48 |
合計ジャッジ時間 | 2,429 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i)) #define REP(i, n) FOR(i,n,0) #define OF64 std::setprecision(10) const ll MOD = 1000000007; const ll INF = (ll) 1e15; int main() { ll A, B; cin >> A >> B; ll n = 0; REP(i, 40) { ll a = ((A >> i) & 1); ll b = ((B >> i) & 1); if (a == 1 && b == 0) { cout << 0 << endl; return 0; } if (a != b) n++; } if (n == 0) cout << 1 << endl; else cout << pow(2LL, n - 1) << endl; return 0; }