题解 | 76选数
76选数
https://www.nowcoder.com/practice/527f85bf9c9c4b74aa4e3ed889c63429
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
int n;
cin >> n;
if (n == 1) cout << 1;
else {
int i=0;
while(n>0){
n>>=1;
i++;
}
int ans=(1LL<<i)-1;
cout<<ans;
}
return 0;
}
// 64 位输出请用 printf("%lld")
