博客网站开发环境,源代码做网站,wordpress添加商城,莱芜如何选择网站建设题意#xff1a;n的阶乘后面0的个数#xff0c;如果直接算出阶乘再数0的数量一定会超时的。因为102*5,所以求出5贡献的次数就行。#include bits/stdc.h
using namespace std;
#define LL long long
#define INF 0x3f3f3f3f3f
#define PI acos(-1)
#define N 510
… 题意n的阶乘后面0的个数如果直接算出阶乘再数0的数量一定会超时的。 因为102*5,所以求出5贡献的次数就行。 #include bits/stdc.h
using namespace std;
#define LL long long
#define INF 0x3f3f3f3f3f
#define PI acos(-1)
#define N 510
LL arr[N];
int main()
{int n,k;while(~scanf(%d,n)){int sum0;while(n0){sumn/5;n/5;}printf(%d\n,sum);}return 0;
} 转载于:https://www.cnblogs.com/kimsimple/p/7460716.html