Type: RemoteJudge 1000ms 512MiB

[USACO3.2] 阶乘问题

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

也许你早就知道阶乘的含义,NN 阶乘是由 11NN 相乘而产生,如:

$$12!=1\times 2\times 3\times 4\times 5\times 6\times 7\times 8\times 9\times 10\times 11\times 12=479{,}001{,}600$$

1212 的阶乘最右边的非零位为 66

写一个程序,计算 N (1N5×107)N\ (1\le N\le5\times 10^7) 阶乘的最右边的非零位的值。

注意10,000,000!10{,}000{,}000! 的末尾有 24999992499999 个零。

输入格式

仅一行包含一个正整数 NN

输出格式

一个整数,表示最右边的非零位的值。

12
6

提示

USACO Training Section 3.2

入门作业3、提高作业1

Not Claimed
Status
Done
Problem
19
Open Since
2026-2-5 0:00
Deadline
2026-2-26 23:59
Extension
24 hour(s)