A
link
模拟整个过程即可。
点击查看代码
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
int h;
cin >> h;
int day = 1ll,g = 0ll;
while(g < h){
g += (1ll<<day);
day++;
}
cout << day;
return 0;
}
link
模拟整个过程即可。
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
int h;
cin >> h;
int day = 1ll,g = 0ll;
while(g < h){
g += (1ll<<day);
day++;
}
cout << day;
return 0;
}