刚学OI一秒钟 求调红题
查看原帖
刚学OI一秒钟 求调红题
475219
_meant_to_be_楼主2024/9/16 17:10

RT

#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,ans;
signed main(){
    int cnt=1;
    cin>>n;
    for(int i=1;;i++){
        if(cnt>=n){
            break;
        }
        cnt=cnt*2;
        if(i%2==0){
            ans=i;
        }
    }
    cout<<ans;
}
2024/9/16 17:10
加载中...