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;
}