标签:i++ cst printf name for using pac sqrt class
良心题,暴力枚举即可。
代码:
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int n,m,ans=1;
int main()
{
scanf("%d%d",&n,&m);
for(int i=1;i<=sqrt(m)+1;i++)
{
if(!(m%i)&&i<=n)ans=max(i,ans);
if(!(m%i)&&m/i<=n){ans=max(ans,m/i);}
}
printf("%d\n",ans);
}
标签:i++ cst printf name for using pac sqrt class
原文地址:https://www.cnblogs.com/lcxer/p/9845812.html