結果
| 問題 |
No.1957 Xor Min
|
| コンテスト | |
| ユーザー |
hiro71687k
|
| 提出日時 | 2022-05-28 00:39:33 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 635 bytes |
| コンパイル時間 | 1,899 ms |
| コンパイル使用メモリ | 193,636 KB |
| 最終ジャッジ日時 | 2025-01-29 16:28:26 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
return 0;
}
x/=2;
x-=1;
cout << x << endl;
}
}
hiro71687k