評分結果(參考) : AC (2ms, 336KB)
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
while(cin >> n){
int ans = 0;
while(n > 0){
n /= 2;
ans++;
}
cout << ans << '\n';
}
return 0;
}
評分結果(參考) : AC (2ms, 336KB)
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
while(cin >> n){
cout << floor(log2(n)) + 1 << '\n';
}
return 0;
}