#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int Help(
int lo,
int hi,
vector<int>& v)
{
int mid = (hi + lo) /
2;
if (mid == v[
1] || (v[
0] < mid && v[
2] > mid))
return mid;
else if (v[
0] >= mid)
{
return Help(mid+
1, hi, v);
}
else
return Help(lo, mid-
1, v);
}
int main()
{
int k;
vector<int> v(
3,
0);
cin >> k >> v[
0] >> v[
1] >> v[
2];
sort(v.begin(), v.end());
int count =
pow(
2, k) -
1;
cout << Help(
1, count, v) << endl;
}
转载请注明原文地址: https://ju.6miu.com/read-101.html