結果
| 問題 |
No.939 and or
|
| コンテスト | |
| ユーザー |
iqueue02
|
| 提出日時 | 2019-12-02 16:41:23 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 515 bytes |
| コンパイル時間 | 1,571 ms |
| コンパイル使用メモリ | 166,404 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-24 11:10:14 |
| 合計ジャッジ時間 | 2,569 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
int main(){
ll a, b;
cin >> a >> b;
if (a == b) {
cout << 1 << endl;
return 0;
}
ll res = 1;
for (int i = 0; i < 32; i++) {
int bit1 = (a & (1 << i)), bit2 = (b & (1 << i));
if (bit1 && !bit2) {
cout << 0 << endl;
return 0;
}
if (!bit1 && bit2) res *= 2;
}
cout << res / 2 << endl;
return 0;
}
iqueue02