[朝阳区小学组 2019] nonzero

Luogu
IDLGB4268
Time1000ms
Memory512MB
DifficultyP2
2019数论北京科创活动小学活动
小明最近对阶乘很感兴趣,但是阶乘增长的太快了。如 $13!$ 就必须用 $64$ 位整数类型来存储,$70!$ 即使浮点数也存不下。小明想知道阶乘最后面的非零位是多少。 例如:$5!=1\times 2\times 3\times 4\times 5=120$,所以 $5!$ 最后面的非零位是 $2$。 $7!=1\times 2\times 3\times 4\times 5\times 6\times 7=5040$,所以 $7!$ 最后面的非零位是 $4$。 ## Input 一行,一个整数 $N$($N\leq1000$)。 ## Output 一行,输出 $N!$ 最后面的非零位。 [samples] ## Background 数据为洛谷自造。
Samples
Input #1
7
Output #1
4
API Response (JSON)
{
  "problem": {
    "name": "[朝阳区小学组 2019] nonzero",
    "description": {
      "content": "小明最近对阶乘很感兴趣,但是阶乘增长的太快了。如 $13!$ 就必须用 $64$ 位整数类型来存储,$70!$ 即使浮点数也存不下。小明想知道阶乘最后面的非零位是多少。 例如:$5!=1\\times 2\\times 3\\times 4\\times 5=120$,所以 $5!$ 最后面的非零位是 $2$。 $7!=1\\times 2\\times 3\\times 4\\times 5\\times 6",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P2"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGB4268"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "小明最近对阶乘很感兴趣,但是阶乘增长的太快了。如 $13!$ 就必须用 $64$ 位整数类型来存储,$70!$ 即使浮点数也存不下。小明想知道阶乘最后面的非零位是多少。\n\n例如:$5!=1\\times 2\\times 3\\times 4\\times 5=120$,所以 $5!$ 最后面的非零位是 $2$。\n\n$7!=1\\times 2\\times 3\\times 4\\times 5\\times 6...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments