154. Factorial
time limit per test: 0.5 sec.memory limit per test: 4096 KB input: standard input
output: standard output
You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*...*N. For example, 5! = 120, 120 contains one zero on the trail.
Input One number Q written in the input (0<=Q<=10^8).
Output Write "No solution", if there is no such number N, and N otherwise.
Sample test(s)
Input 2 Output 10 题目描述:输入一个数n、求某个数的阶乘后面有n个0的数p; 会了poj1401就好办了、直接来个二分搜素。
#include#include #include #include #include #include #include #include #include #include #include