hdu1018 big number
来源:互联网 发布:网络直播营销方案 编辑:程序博客网 时间:2024/05/21 10:54
Big Number
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 36229 Accepted Submission(s): 17333
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
2
10
20
Sample Output
7
19
利用对数求位数
#include <stdio.h>#include <stdlib.h>#include <math.h>#define PI 3.14159265359#define E 2.718281828459int main(){ double s; int n,m; while(scanf("%d",&n)!=EOF) { while(n--) { scanf("%d",&m); s=0.0; if(m>3) { s=log10(2*PI*m)/2+m*log10(m/E); } m=s+1; printf("%d\n",m); } } return 0;}
- HDU1018 Big Number
- HDU1018 Big Number
- hdu1018-Big Number
- poj1423 hdu1018 Big Number
- hdu1018 Big Number
- HDU1018 Big Number
- hdu1018 Big Number
- hdu1018 big number
- HDU1018 Big Number
- HDU1018(Big Number)
- HDU1018 Big Number
- hdu1018 Big Number
- hdu1018 big number
- hdu1018 - Big Number
- HDU1018-Big Number
- hdu1018—Big Number
- HDU1018 Big Number
- 求阶乘--hdu1018--Big Number
- Elasticsearch Terms Aggregation 根据某一项的聚合
- 4-基本布局+CSS样式属性+盒子模型
- cf 743D
- CodeForces-743D Chloe and pleasant prizes(树型dp)
- usaco Electric Fence
- hdu1018 big number
- 转发与重定向的区别
- Ubuntu自动生成图片文件名列表
- 我的编程之路(0)
- MWeb for MAC 支持csdn的blog了
- C 程序1
- 初识Nginx
- Print Article_hdu3507_斜率优化dp
- Dropout_layer.cpp(防止过拟合)