結果
| 問題 |
No.939 and or
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-01-14 07:26:55 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 504 bytes |
| コンパイル時間 | 2,296 ms |
| コンパイル使用メモリ | 191,316 KB |
| 最終ジャッジ日時 | 2025-01-08 17:54:53 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 WA * 5 |
ソースコード
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
ios::sync_with_stdio(false); cin.tie(0);
long long a, b;
cin >> a >> b;
int cnt = 0;
for (int i = 0; i < 33; i++) {
// cerr << ((a >> i) & 1) << " " << ((b >> i) & 1) << endl;
if ((a & (1LL << i)) == 0 && (b & (1LL << i))) cnt++;
if (((a >> i) & 1) == 1 && (b & (1LL << i)) == 0) {
cout << 0 << '\n';
return 0;
}
}
cout << (long long) pow(2, cnt) / 2 << '\n';
return 0;
}