結果
| 問題 |
No.939 and or
|
| コンテスト | |
| ユーザー |
square1001
|
| 提出日時 | 2020-01-15 20:35:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 323 bytes |
| コンパイル時間 | 566 ms |
| コンパイル使用メモリ | 66,688 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-11 19:22:19 |
| 合計ジャッジ時間 | 1,317 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
#include <vector>
#include <iostream>
using namespace std;
int main() {
long long X, Y;
cin >> X >> Y;
long long ans = 1;
for (int i = 0; i < 32; ++i) {
int b1 = ((X >> i) & 1), b2 = ((Y >> i) & 1);
if (b1 == 1 && b2 == 0) ans = 0;
if (b1 == 0 && b2 == 1) ans *= 2;
}
cout << (ans + 1) / 2 << endl;
return 0;
}
square1001