题解 | 76选数
76选数
https://www.nowcoder.com/practice/527f85bf9c9c4b74aa4e3ed889c63429
#include <iostream>
using namespace std;
int main() {
unsigned long long n,m =1;
cin>>n;
while(m<n){
m=(m<<1)|1;
}
cout<<m<<endl;
return 0;
}
// 64 位输出请用 printf("%lld")

查看20道真题和解析