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 ...
随机推荐
- demo07
city_data.xml <?xml version="1.0" encoding="utf-8"?> <resources> < ...
- paper 73 :HDR(High Dynamic Range Imaging)在摄影中指高动态范围成像
HDR(High Dynamic Range Imaging)在摄影中指高动态范围成像.国内的教程基本语焉不详,找到一篇比较详尽的国外教程翻译出来,希望对大家有帮助.^_^ 原文地址:http://p ...
- html5文件上传
<!DOCTYPE html><html><head> <title>Html5 Ajax 上传文件</title></head> ...
- oracle的冷备份
oracle冷备份要备份三类文件:数据文件,控制文件,日志文件 查看所有数据文件 select name from v$datafile; 查看所有日志文件 select member from v$ ...
- LDA-math-认识Beta/Dirichlet分布
http://cos.name/2013/01/lda-math-beta-dirichlet/#more-6953 2. 认识Beta/Dirichlet分布2.1 魔鬼的游戏—认识Beta 分布 ...
- HTML5的自定义属性data-* 的用法解析
人们总喜欢往HTML标签上添加自定义属性来存储和操作数据.但这样做的问题是,你不知道将来会不会有其它脚本把你的自定义属性给重置掉,此外,你这样做也会导致html语法上不符合Html规范,以及一些其它副 ...
- [OrangePi] If you are using an older image
Download scriptbin_kernel.tar.gz from Mega, unpack. Copy uImage_OPI-2 or uImage_OPI-PLUS (depending ...
- Openstack的镜像属性
先来看张图: 容易理解的地方我们就不介绍了,我们这里介绍'公有'和'受保护'的 在shell命令中,公有用is-public=True表示,而受保护的用is-protected表示,公有的反面是is- ...
- android 应用架构随笔四(View、ViewGroup)
View表示了用户界面的基本构建模块. 一个View占用了屏幕上的一个矩形区域并且负责界面绘制和事件处理.手机屏幕上所有看得见摸得着的都是View. Activity是四大组件中唯一一个用来和用户进行 ...
- FastDFS配置说明
前面了解了fastdfs的原理,接下来就熟悉一下安装过程,准备了三台机器,一台模拟client,一台模拟storage,一台模拟tracker. 三台机器均为debian6,系统为最小化安装, ...