1 solutions

  • 0
    @ 2022-8-29 16:07:34
    #include<iostream>
    #include<cstring>
    using namespace std;
    int v;
    int n=1;
    int count=1;
    int main(){
    		cin>>v;
    		v=v-1;
    		while(v>=count*2){
    			n++;
    			count*=2;
    			v-=count;
    		}
    		if(v==0){
    		cout<<n<<endl;
    	}
    	else cout<<n+1<<endl;
    	return 0;
    }
    

    Information

    ID
    6547
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    # Submissions
    24
    Accepted
    12
    Uploaded By