Codeforces 633B A Trivial Problem
2 seconds
256 megabytes
standard input
standard output
Mr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer m and asks for the number of positive integers n, such that the factorial of n ends with exactly m zeroes. Are you among those great programmers who can solve this problem?
The only line of input contains an integer m (1 ≤ m ≤ 100 000) — the required number of trailing zeroes in factorial.
First print k — the number of values of n such that the factorial of n ends with m zeroes. Then print these k integers in increasing order.
1
5 5 6 7 8 9
5
0
The factorial of n is equal to the product of all integers from 1 to n inclusive, that is n! = 1·2·3·...·n.
In the first sample, 5! = 120, 6! = 720, 7! = 5040, 8! = 40320 and 9! = 362880.
题目大意:输入整数n,输出所有满足阶乘后缀有n个0的数
题解:10是由5*2得来,既找出阶乘的因子有几个5(5>2,有5就有2)
#include <bits/stdc++.h> using namespace std; int main() { int a, i, n, n1, j; scanf("%d", &n); ;n>;i++) { n1=i; ==) { n1 /= ; n--; } } ) printf("0\n"); else { printf("5\n"); ;j<=i+;j++) printf("%d ", j); printf("\n"); } ; }
Codeforces 633B A Trivial Problem的更多相关文章
- CodeForces - 633B A Trivial Problem 数论-阶乘后缀0
A Trivial Problem Mr. Santa asks all the great programmers of the world to solve a trivial problem. ...
- cf 633B A trivial problem
Mr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an i ...
- codeforces 633B B. A Trivial Problem(数论)
B. A Trivial Problem time limit per test 2 seconds memory limit per test 256 megabytes input standar ...
- Manthan, Codefest 16 B. A Trivial Problem 二分 数学
B. A Trivial Problem 题目连接: http://www.codeforces.com/contest/633/problem/B Description Mr. Santa ask ...
- Manthan, Codefest 16(B--A Trivial Problem)
B. A Trivial Problem time limit per test 2 seconds memory limit per test 256 megabytes input standar ...
- [codeforces 528]B. Clique Problem
[codeforces 528]B. Clique Problem 试题描述 The clique problem is one of the most well-known NP-complete ...
- codeforces.com/contest/325/problem/B
http://codeforces.com/contest/325/problem/B B. Stadium and Games time limit per test 1 second memory ...
- Codeforces 442B Andrey and Problem(贪婪)
题目链接:Codeforces 442B Andrey and Problem 题目大意:Andrey有一个问题,想要朋友们为自己出一道题,如今他有n个朋友.每一个朋友想出题目的概率为pi,可是他能够 ...
- CodeForces 867B Save the problem
B. Save the problem! http://codeforces.com/contest/867/problem/B time limit per test 2 seconds memor ...
随机推荐
- struts_24_基于XML校验的规则、特点
当为某个action提供了ActionClassName-validation.xml和ActionClassName-ActionName-validation.xml两种规则的校验文件时,系统按下 ...
- Android bindservice使用
package com.example.myact10; import com.example.myact10.MyService.MyBinder; import android.support.v ...
- 夺命雷公狗ThinkPHP项目之----企业网站14之文章修改页的完成
这个其实也是挺容易的,我们思路先将栏目页给遍历出来: 这里用了catTree的方法,因为我们要对遍历出来的数据进行排序的,然后来到前端进行完成列表: <!doctype html> < ...
- Scrum站立会议----11月4日
小组名称:nice! 组长:李权 成员:于淼 刘芳芳韩媛媛 宫丽君 时间:2016.11.4 12:00--12:30 地点:传媒西楼220室 代码地址:Https: https://git ...
- 【SPFA】 最短路计数
最短路计数 [问题描述] 给出一个N个顶点M条边的无向无权图,顶点编号为1-N.问从顶点1开始,到其他每个点的最短路有几条. [输入格式] 输入第一行包含2个正整数N,M,为图的顶点数与边数. ...
- android 应用架构随笔六(Loading加载页面)
import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import com.heima ...
- :first // :last
描述: 获取匹配的第一个元素 HTML 代码: <ul> <li>list item 1</li> <li>list item 2</li> ...
- 如何清除DNS缓存,使用cmd命令清理DNS缓存方法
如何清除DNS缓存,使用cmd命令清理DNS缓存方法 有时候电脑突然上不了网,或者存在某些网站打不开的情况,但别的网站又可以打开,解决办法需要清除DNS缓存,那么如何清除DNS缓存呢,最常用的方法就是 ...
- TreeNode动态邦定事件
1. 显示不能用TextField,应该用StaticText 2. public void SetNodesAction(Tree t, String methodbind){ ArrayList ...
- docker学习整理
1.安装 Docker 支持 CentOS6 及以后的版本 对于 CentOS6,可以使用 EPEL 库安装 Docker CentOS7 系统 CentOS-Extras 库中已带 Docker,可 ...