20分,求助
查看原帖
20分,求助
1123497
Twit楼主2024/10/9 17:09
#include<bits/stdc++.h>
using namespace std;
double n,m;
double cs;
double l,r;
bool x;
int main(){
	cin>>n>>m;
	cin>>cs;
	l = m/cs;
	if(cs!=1){
		r = m/(cs-1);
		x=true;
	}
	//cout<<l<<" "<<r<<endl;
	for(int i=2;i<=n;i++){
		cin>>cs;
		if( m/cs/i>l ){
			l = m/cs/i;
		}
		if(cs!=1){
			if( m/(cs-1)/i < r ){
				r = m/(cs-1)/i;
				x=true;
			}
		}
		//cout<<l<<" "<<r<<endl; 
	}
	if(true){
		cout<<floor(r)-ceil(l)+1;
	}else{
		cout<<"xiaogougege";
	}
	
	return 0;
}
2024/10/9 17:09
加载中...