結果
問題 |
No.1957 Xor Min
|
ユーザー |
![]() |
提出日時 | 2022-05-28 00:37:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 622 bytes |
コンパイル時間 | 2,013 ms |
コンパイル使用メモリ | 191,676 KB |
最終ジャッジ日時 | 2025-01-29 16:28:18 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=long long; using ld=long double; ll inf=10010010010010010; ll mod=1000000007; int main(){ ll a,b; cin >> a >> b ; ll x=1; while (x<a&&x<b) { x*=2; } if (x==a||x==b) { if (a==b) { cout << x-1 << endl; }else if (max(a,b)>=x*2) { cout << x << endl; }else{ cout << x-1 << endl; } }else{ if (x-1==min(a,b)) { cout << x-1 << endl; } x/=2; x-=1; cout << x << endl; } }