本人刚学 c++ 两天,现在 c++ 都这么难吗
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll a, b;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> a >> b;
ll l = -1e18, r = 1e18;
while (l < r)
{
ll mid = (l + r) >> 1;
if (mid - b > a)
r = mid - 1;
else
l = mid;
}
cout << l << '\n';
return 0;
}