Big Number
来源:互联网 发布:无钢圈内衣品牌 知乎 编辑:程序博客网 时间:2024/04/30 00:25
Big Number
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 3 Accepted Submission(s) : 2
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
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)
求阶乘的位数,比方5的阶乘120是3位,输出3
一个数学算法,主要用公式
#include <stdio.h>#include <math.h>#define pi 3.1415926535#define E 2.71828182846long m,n,ss;int main(){ scanf("%d",&n); while(n--) { scanf("%d",&m); ss=log10(sqrt(2*pi*m))+m*log10(m/E); //公式 printf("%d\n",ss+1); }}
- big big number 求和
- big number
- Big Number
- Big Number
- big number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- Big Number
- 三极管做开关,常用到的电容作用(旁路-输入,去耦-输出、电源,运放中的补偿电容)
- 【九度】题目1335:闯迷宫(40分)
- wikioi 1046 旅行家的预算
- 解决SQL Server2008中修改数据后无法保存问题
- ASP.NET页面事件顺序
- Big Number
- 杨辉三角的变形
- Android版百度地图MapView维护
- 哈希排序
- Oracle 索引 详解
- 背英语
- Windows Programming 第二章 Unicode简介
- BDTC 参会总结
- ARM7的模式