poj - 1423-Big number
来源:互联网 发布:Ping应用的端口号 编辑:程序博客网 时间:2024/05/17 01:44
H - Big Number
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uDescription
In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of digits in the factorial of the number.
Input
Input consists of several lines of integer numbers. The first line contains an integer n, which is the number of cases to be tested, followed by n lines, one integer 1 <= m <= 10^7 on each line.
Output
The output contains the number of digits in the factorial of the integers appearing in the input.
Sample Input
21020
Sample Output
719
代码:
#include <cstdio>#include <cmath>#include <iostream>using namespace std;int a[10000001];int main() {int n, i, cas;double s;for(i = 1,s = 0;i <= 10000000; i ++) {s += log10((double)i);a[i] = (int)s + 1;}scanf("%d", &cas);while (cas --) {scanf("%d", &n);printf("%d\n", a[n]);}return 0;}
- POJ 1423 Big Number
- POJ 1423 Big Number
- POJ 1423 Big Number
- poj 1423 Big Number
- poj 1423 big number
- POJ 1423 Big Number
- POJ 1423 Big Number
- poj 1423 Big Number
- big number poj 1423
- POJ 1423 Big Number
- POJ 1423 Big Number
- poj - 1423-Big number
- POJ:1423 Big Number
- poj 1423 Big Number
- POJ 1423 Big Number
- 【poj】1423 Big number
- POJ 1423 BIG NUMBER
- POJ 1423 Big Number
- 常用的正则表达式全面总结
- WinCE开发中Boot Loader的点点滴滴
- 大数据时代下我可以做什么
- jquery学习之——图片轮播的代码解释
- 理解 Windows CE .NET 中的文件系统体系结构
- poj - 1423-Big number
- 黑马程序员---7k面试题(银行业务调度系统)
- 今天开始学python(内置数据类型)
- Maximum Subsequence Sum Problem最大顺序子序列求和
- C指针内存问题疑惑
- poj 2075-最小生成树-map映射
- 自学Node.js 三:优化路由逻辑
- 《程序员》ipad版 吐槽
- passdb backend = tdbsam