15pts求调 输出很多0
查看原帖
15pts求调 输出很多0
1114867
1nes楼主2024/10/24 20:26
#include<bits/stdc++.h>
using namespace std;
int n , x;
int main(){
	cin >> x >> n;
	if(x >= (1 << n)){
		cout << 0;
	}
	else{
		if(n == 2){
			cout << 1;
		}
		else{
			if(x == 2)	cout << "inf";
			else	cout <<ceil(log2((n - 2) / log2(x) - 1));
		}
	}
	return 0;	
}
2024/10/24 20:26
加载中...