hdoj--1018--Big Number(简单数学)
Big Number
digits in the factorial of the number.
2 10 20
7 19
- //#include<stdio.h>
- //#include<string.h>
- //int main()
- //{
- // int t;
- // scanf("%d",&t);
- // int n,num[200];
- // while(t--)
- // {
- // memset(num,0,sizeof(num));
- // num[0]=1;
- // scanf("%d",&n);
- // int j;
- // int c=0;
- // for(int i=1;i<=n;i++)
- // {
- // for(j=0;j<=199;j++)
- // {
- // num[j]=num[j]*i+c;
- // if(num[j]>=10)
- // {
- // c=num[j]/10;
- // num[j]-=c*10;
- // }
- // else c=0;
- // }
- //
- // }
- // for(j=199;j>=0;j--)
- // if(num[j]!=0)
- // break;
- // printf("%d\n",j+1);
- // }
- // return 0;
- //}
- #include<stdio.h>
- #include<string.h>
- #include<math.h>
- int main()
- {
- int t;
- scanf("%d",&t);
- while(t--)
- {
- int n;
- scanf("%d",&n);
- double ans=0;
- for(int i=1;i<=n;i++)
- ans+=log10(i);
- printf("%d\n",(int)ans+1);
- }
- return 0;
- }
hdoj--1018--Big Number(简单数学)的更多相关文章
- HDOJ 1018 Big Number(大数位数公式)
Problem Description In many applications very large integers numbers are required. Some of these app ...
- 计蒜客 31452 - Supreme Number - [简单数学][2018ICPC沈阳网络预赛K题]
题目链接:https://nanti.jisuanke.com/t/31452 A prime number (or a prime) is a natural number greater than ...
- SDUT 3258 Square Number 简单数学
和上一题一样,把平方因子除去,然后对应的数就变成固定的 #include <cstdio> #include <iostream> #include <algorithm ...
- SDUT 3257 Cube Number 简单数学
把所有数的立方因子除去,那么一个数可以和它组成立方的数是确定的,统计就行 #include <cstdio> #include <iostream> #include < ...
- HDU 5073 Galaxy (2014 Anshan D简单数学)
HDU 5073 Galaxy (2014 Anshan D简单数学) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5073 Description G ...
- HDOJ 1501 Zipper 【简单DP】
HDOJ 1501 Zipper [简单DP] Problem Description Given three strings, you are to determine whether the th ...
- 水题 HDOJ 4727 The Number Off of FFF
题目传送门 /* 水题:判断前后的差值是否为1,b[i]记录差值,若没有找到,则是第一个出错 */ #include <cstdio> #include <iostream> ...
- 洛谷试炼场-简单数学问题-P1403 [AHOI2005]-因数
洛谷试炼场-简单数学问题 P1403 [AHOI2005]约数研究 Description 科学家们在Samuel星球上的探险得到了丰富的能源储备,这使得空间站中大型计算机"Samuel I ...
- 洛谷试炼场-简单数学问题-P1045 麦森数-高精度快速幂
洛谷试炼场-简单数学问题 B--P1045 麦森数 Description 形如2^P−1的素数称为麦森数,这时P一定也是个素数.但反过来不一定,即如果PP是个素数,2^P-1 不一定也是素数.到19 ...
随机推荐
- BZOJ 2324 (有上下界的)费用流
思路: 先跑一遍Floyd 更新的时候map[i][j]=map[i][k]+map[k][j] k需要小于i或j 正常建边: 把所有点 拆点-> i,i+n add(x,y,C,E)表示x ...
- WebDav协议基于HTTP 1
首先第一篇提供配置WebDav的方式 网上找了两篇比较好的配置方式分别适用于Win7 Win2003,而且都经过测试配置可以正常使用 原文中保留了引用地址,这个纯属为了要尊重别人的劳动成果 在第二篇中 ...
- WPF黑色背景下常用控件样式
平时工作用 自己整理的 代码等找到合适的上传空间在进行同步
- Svn install and use
1.安装服务 使用yum安装subversion,简单.不繁琐. 1 yum install -y subversion 2.创建版本库 1 2 mkidr /svn/obj ...
- 前端面试基础-html篇之CSS3新特性
CSS3的新特性(个人总结)如下 过度(transiton) 动画(animation) 形状转换 transform:适用于2D或3D转换的元素 transform-origin:转换元素的位置(围 ...
- CSS3伪元素、伪类选择器
伪元素选择器: ::first-letter:为某个元素中的文字的首字母或第一个字使用样式. ::first-line:为某个元素的第一行文字使用样式. ::before:在某个元素之前插入一些内容. ...
- BluetoothA2dp蓝牙音箱的连接
1:权限 <uses-feature android:name="android.hardware.bluetooth_le" android:required=" ...
- django 安装运行
pip install django pip list 查看版本 python -m django --version 新建django django-admin startproject mysit ...
- mvc cshtml 字符串操作
@using System.Text; @{ ; string str=""; StringBuilder sb = new StringBuilder(); } @foreach ...
- .apply .call方法的区别及使用 .apply第二个参数为数组,.call第二个参数为参数列表, 相同点:第一个参数都为Function函数内部的this对象.
Function.apply(obj,args)方法能接收两个参数 obj:这个对象将代替Function类里this对象 args:这个是数组,它将作为参数传给Function(args--> ...