結果
| 問題 |
No.1957 Xor Min
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-27 22:31:36 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 431 bytes |
| コンパイル時間 | 2,413 ms |
| コンパイル使用メモリ | 242,452 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-20 16:08:45 |
| 合計ジャッジ時間 | 3,392 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 8 WA * 17 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using std::cin;
using std::cout;
using std::vector;
using P = std::pair<int, int>;
int main() {
int a, b;
cin >> a >> b;
if (a == b) {
cout << std::min(std::min(a, a-1), a^(a-1)) << '\n';
return 0;
}
if (a > b) std::swap(a, b);
cout << std::min(std::min(a, a+1), a^(a+1)) << '\n';
return 0;
}