SP8785 题解
翻译:
一个矿工要在 天内第 天给债主 单位的银条,来拿回上一天给的 单位银条。求出矿工分割银条的最少次数。
我看了半天,发现答案就是 。 非常水的一道题,AC代码:
#include<bits/stdc++.h>
using namespace std;
int n;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
while(cin>>n&&n!=0){
cout<<int(log2(n))<<endl;
}
}