用log解决
查看原帖
用log解决
1356528
yuhangwu楼主2024/12/15 16:22
#include<bits/stdc++.h>
using namespace std;
int LOG(long x){return log(x)/log(2);}
int main(){
    int n;cin>>n;
    if (LOG(n-1)%2==0) cout<<LOG(n-1);
    else cout<<LOG(n-1)-1;
}

红红火火恍恍惚惚

2024/12/15 16:22
加载中...