Solution
水题。二进制拆分即可。
Code
#include<bits/stdc++.h> using namespace std; int m,ans; int main(){ cin>>m; int s=1; while(m>=s){ ++ans; m-=s; s<<=1; } if(m) ++ans; cout<<ans<<endl; return 0; }