結果
問題 | No.939 and or |
ユーザー |
|
提出日時 | 2019-12-15 01:02:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,395 bytes |
コンパイル時間 | 1,486 ms |
コンパイル使用メモリ | 166,096 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-28 09:37:26 |
合計ジャッジ時間 | 2,500 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
//confilm 0LL and 1LL //confilm cornercase such as 0 #include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; using Vec = vector<ll>; using VecP = vector<P>; using VecB = vector<bool>; #define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i)) #define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i)) #define REPR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i)) #define rep(i, n) REP(i, 0, n) #define repn(i, n) REPN(i, 1, n) #define repr(i, n) REPR(i, n, 0) #define repnr(i, n) REPR(i, n, 1) #define co(n) cout << (n) << endl #define cosp(n) cout << (n) << ' ' #define setp(n) cout << fixed << setprecision(n); #define all(s) (s).begin(), (s).end() #define pb push_back #define mp make_pair #define mt make_tuple #define fs first #define sc second template <typename T> bool chmax(T &a, const T& b){if(a < b){a = b; return true;} return false;} template <typename T> bool chmin(T &a, const T& b){if(a > b){a = b; return true;} return false;} const ll INF = 1e9+1; const ll LINF = 1e18+1; const ll MOD = 1e9+7; //const ll MOD = 998244353; const double PI = acos(-1); const double EPS = 1e-9; int main(void){ ll a, b; cin >> a >> b; bitset<32> bitA(a), bitB(b); rep(i, 32) if(bitA[i] && !bitB[i]){ co(0); return 0; } ll n = bitB.count()-bitA.count(); if(n) co(1 << (n-1)); else co(1); return 0; }