結果
| 問題 | No.1957 Xor Min |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-28 12:26:46 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 462 bytes |
| 記録 | |
| コンパイル時間 | 1,276 ms |
| コンパイル使用メモリ | 208,336 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-26 07:17:38 |
| 合計ジャッジ時間 | 2,351 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
signed main() {
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(cin.failbit);
unsigned x, y;
cin >> x >> y;
if (__builtin_clz(x) > __builtin_clz(y)) {
swap(x, y);
}
unsigned ans = 0;
if (__builtin_clz(x) == __builtin_clz(y)) {
ans = (1 << (31 - __builtin_clz(y))) - 1;
} else {
ans = y;
}
cout << ans << '\n';
return 0;
}