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 ...
随机推荐
- 08---Net基础加强
资料管理器作业 public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void F ...
- EBS多OU和多帐套客户化总结
(一) 多OU总结 . Form多OU实现 ) 创建一个Table,以CUX_AP_CHECK_HEADER_ALL为例 ) 创建Table的两个Synonym(一个不含_ALL,一个以_ALL结尾) ...
- Fatal error: Call to a member function bind_param() on a non-object in
今天在练习 mysql是出现错误: Fatal error: Call to a member function bind_param() on a non-object in 解决步骤: 1. ...
- pic计数
#include <pic.h> //用的是PICC编译器 __CONFIG (HS & PROTECT & PWRTEN & BOREN & WDTDIS ...
- Mysql数据库读写分离配置
环境模拟 实现读写分离 减轻数据库的负荷 主服务器 master 10.0.0.12 从服务器 slave 10.0.0.66 配置主服务器: 在10.0.0.12服务器操作 创建数据 ...
- Spring 复习笔记01
Spring 框架 1. core:整个Spring框架构建在Core核心模块上,它是整个框架的的基础. 2. AOP:AOP模块提供了一个轻便但功能强大强大的AOP框架,让我们可以以AOP的形式增强 ...
- git-gui
使用Git.Git GUI和TortoiseGit http://zengrong.net/post/1722.htm 但云桌面不能安装,则TortoiseGit不能使用! 只能想到用totalcmd ...
- 精简高效的CSS命名准则/方法
/* ---------------------single CSS----------------------- */ /* display */ .dn{display:none;} .di{di ...
- eclipse字体颜色设置
修改编码:window-->perference--->General--> Configure.--> Configure.-->workspace修改编辑背景色:wi ...
- 160926、Java-SpringMVC统一异常处理
从零开始学 Java - Spring MVC 统一异常处理 看到 Exception 这个单词都心慌 如果有一天你发现好久没有看到Exception这个单词了,那你会不会想念她?我是不会的.她如女孩 ...