結果
| 問題 | 
                            No.1957 Xor Min
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-05-27 22:27:59 | 
| 言語 | C++17(clang)  (17.0.6 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 599 bytes | 
| コンパイル時間 | 1,005 ms | 
| コンパイル使用メモリ | 142,588 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-09-20 16:07:05 | 
| 合計ジャッジ時間 | 1,781 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 14 WA * 11 | 
ソースコード
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
  ll a, b;
  cin >> a >> b;
  ll c = max(a, b);
  ll d = min(a, b);
  if(c == 1) {
    cout << 0 << endl;
    return 0;
  }
  ll ans = 1;
  while(ans < d) {
    ans *= 2;
  }
  if(ans - 1 == d) {
    cout << ans - 1 << endl;
    return 0;
  }
  ans /= 2;
  cout << max(ans - 1, (ll)1) << endl;
  return 0;
}