我的程序
```
#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
inline LL read()
{
LL x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
return x*f;
}
const LL mod=1e11;
int n;
unsigned long long tmp;
int main()
{
freopen("1.in","r",stdin);
freopen("1e11.out","w",stdout);
n=read();
tmp=1;
for(int i=1;i<=n;++i){
tmp=tmp*i;
while(tmp%10==0){
tmp/=10;
}
tmp%=mod;
if(n-i<=1000000)printf("%lld\n",tmp%10);
}
return 0;
}
```
```
#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
inline LL read()
{
LL x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
return x*f;
}
const LL mod=1e12,mod2=1e11;
int n;
unsigned long long tmp;
int main()
{
freopen("1.in","r",stdin);
freopen("my.out","w",stdout);
n=read();
tmp=1;
for(int i=1;i<=n;++i){
if(tmp%2==0&&i%5==0){
tmp%=mod;
tmp=(tmp>>1)*(i/5);
}
else{
tmp%=mod2;
tmp=tmp*i;
}
while(tmp%10==0){
tmp/=10;
}
if(n-i<=1000000)printf("%lld\n",tmp%10);
}
return 0;
}
```
```
@[echo](/space/show?uid=15285) off
fc my.out 1e11.out
pause
end
```
by littleming @ 2018-06-25 23:01:03
@ echo为什么出锅了
by littleming @ 2018-06-25 23:01:32
to管理员:可以加一些4.9e7到5e7之间的数
by littleming @ 2018-06-25 23:20:02
[n其实可以1e10000的](https://www.luogu.org/problemnew/show/P2529)
by WinXP @ 2018-06-26 08:21:08
@[WinXP](/space/show?uid=98650)
双倍经验诶
这题暴力可以过
研究一下暴力也是挺有用的吧
by littleming @ 2018-06-26 21:51:26
@[littleming](/space/show?uid=15090) 哪里有双倍经验?
by _King__ @ 2018-08-24 10:25:22