这题有普及/提高-?

P2388 阶乘之乘

@[引领天下](/space/show?uid=39863) 卡常加两个难度(逃
by chen_zhe @ 2018-08-07 21:25:56


@[chen_zhe](/space/show?uid=8457) 什么鬼……这题目哪里卡常了???
by 引领天下 @ 2018-08-07 21:28:44


@[chen_zhe](/space/show?uid=8457) 这个大佬0ms[AC](https://www.luogu.org/record/show?rid=9427627)
by 引领天下 @ 2018-08-07 21:29:54


@[引领天下](/space/show?uid=39863) 正常做法直接模拟容易被卡常啊QAQ我被卡过几次
by chen_zhe @ 2018-08-07 21:36:33


@[引领天下](/space/show?uid=39863) 双循环60分,单循环才能100分,但难想到,~~本蒟蒻被卡了3次~~
by skiy_gyx @ 2018-08-08 11:43:03


纯数论题
by Ricken @ 2019-08-30 10:45:19


```cpp #include<bits/stdc++.h> using namespace std; long long n,ans; int main() { ios::sync_with_stdio(false); cin >> n; for(register int i = 5; i <= n - 5; i += 5) { int t = 0,j = i; while(j) { j /= 5; t += j; } ans += t * 5; } int t = 0,j = n; while(j) { j /= 5; t += j; } cout << ans + (n - n / 5 * 5 + 1) * t; return 0; } ```
by WDySrDbMoAuMc @ 2019-09-23 22:05:28


|