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