PRoblem Link:http://139.129.36.234/problem.php?id=1262
23 63 3样例输出
22提示
来源
2016北京邮电大学复试机试题
AC code:
#include<iostream>#include<algorithm>#include<stdio.h>#include<map>#include<math.h>#include<string.h>#include<queue>#include<vector>#include<set>#define LL long long#define exp 1e-9#define MAXN 1000010using namespace std;int main(){// freopen("D://in.txt","r",stdin); int i,j,k,n,m,l,t,ans; scanf("%d",&t); for(i=1;i<=t;i++) { scanf("%d%d",&n,&m); ans=0; k=(int)sqrt(m); for(j=1;j<=k&&j<=n;j++) { if(m%j==0) { l=m/j; if(l<=n) { if(l!=j) ans+=2; else { ans+=1; }// printf("j=%d l=%d/n",j,l); } } } printf("%d/n",ans); } return 0;}
新闻热点
疑难解答