結果
問題 |
No.1957 Xor Min
|
ユーザー |
|
提出日時 | 2022-05-27 22:54:34 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 565 bytes |
コンパイル時間 | 2,064 ms |
コンパイル使用メモリ | 142,828 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-20 16:16:22 |
合計ジャッジ時間 | 2,725 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 WA * 9 |
ソースコード
#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 * 2 - 1 <= d) { ans *= 2; } if(c == d && d == ans - 1) { ans /= 2; } cout << ans - 1 << endl; return 0; }