谁能帮忙提供一下优化思路?
查看原帖
谁能帮忙提供一下优化思路?
1113040
__Real_Madrid__楼主2024/8/18 21:18

TLE 0pts,谁能帮忙提供一下优化思路?

#include<bits/stdc++.h>
using namespace std;
int f[105];
int main(){
	int a,d,ans;
	cin>>a;
	for(int i=1;;i++){
		d=a/=2;
		if(d%1!=0){
			ans=i-1;
			break;
		}
	}
	cout<<ans;
	return 0;
}

感谢!!

2024/8/18 21:18
加载中...