题解 | #切蛋糕#
我爱城科软协!
https://ac.nowcoder.com/acm/contest/72285/A
#include<iostream>
#include<string>
using namespace std;
int main()
{
int n;
cin >> n;
if(n & (n-1) == 0) cout << n << " " << 0 << endl;
else{
int limit = (n&(n-1)) ^ n;
int ans = 0;
while(limit < n){
limit <<= 1;
ans++;
}
cout << limit << " " << ans << endl;
}
return 0;
}