hdu1018!【数学】
来源:互联网 发布:禁用445端口 编辑:程序博客网 时间:2024/05/17 03:56
Big Number
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25839 Accepted Submission(s): 11731
Problem Description
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 ≤ n ≤ 107 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
Source
Asia 2002, Dhaka (Bengal)
#include<stdio.h>#include<math.h> int main(){int i, j, k, n;double sum;scanf("%d", &n);while(n--){scanf("%d", &k);sum = 0;for(i = 1; i <= k; i++)sum += log10(i);printf("%d\n", (int)sum + 1); }return 0;}
0 0
- hdu1018!【数学】
- hdu1018 阶乘位数的数学原理
- hdu1018
- hdu1018
- hdu1018
- hdu1018
- hdu1018
- hdu1018
- hdu1018
- HDU1018
- hdu1018
- HDU1018
- hdu1018
- HDU1018
- HDU1018
- HDU1018
- hdu1018
- hdu1018
- 监听类的写法
- [小技巧] 对当前目录的文件按大小排序
- shell脚本,每次读取文件的一行,逐行读取并处理
- 每天一个linux命令目录
- 如何在Table组件中使用Active Data Service?
- hdu1018!【数学】
- PAT 1046. Shortest Distance
- JAVA的IO
- java集合框架小结
- 使用Choice List 实现LOV
- A Python Script to Disassemble a Block in LLDB
- Java初始化顺序
- poj1094
- 哈夫曼树及其应用-最优二叉树