Problem 2908 --3.2.1 Factorials

2908: 3.2.1 Factorials

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $9$ 正确数量 $3$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 usaco

The factorial of an integer N, written N!, is the product of all the integers from 1 through N inclusive. The factorial quickly becomes very large: 13! is too large to store in a 32-bit integer on most computers, and 70! is too large for most floating-point variables. Your task is to find the rightmost non-zero digit of n!. For example, 5! = 1 * 2 * 3 * 4 * 5 = 120, so the rightmost non-zero digit of 5! is 2. Likewise, 7! = 1 * 2 * 3 * 4 * 5 * 6 * 7 = 5040, so the rightmost non-zero digit of 7! is 4.


A single positive integer N no larger than 4,220.

A single line containing but a single digit: the right most non-zero digit of N! .

7
4

推荐代码 查看2908 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] AOJ大管家 445493 2019-06-22 21:12:00
内存最少[$1116 $KB] AOJ大管家 445493 2019-06-22 21:12:00
第一AC AOJ大管家 445493 2019-06-22 21:12:00
第一挑战 AOJ大管家 445493 2019-06-22 21:12:00

赛题来源/所属竞赛 usaco training usaco Training

竞赛编号 竞赛名称 竞赛时间 访问比赛