题解:SP8785 SILVER - Cut the Silver Bar
题意简述
一个矿工要在
题目分析
不难猜到
先证
再证
代码
#include<bits/stdc++.h>
using namespace std;
int n;
int main(){
cin.tie(0)->sync_with_stdio(0);
while(cin>>n&&n)cout<<int(log2(n))<<'\n';
}
一个矿工要在
不难猜到
先证
再证
#include<bits/stdc++.h>
using namespace std;
int n;
int main(){
cin.tie(0)->sync_with_stdio(0);
while(cin>>n&&n)cout<<int(log2(n))<<'\n';
}