Number lengths FZU - 1050】的更多相关文章

N! (N factorial) can be quite irritating and difficult to compute for large values of N. So instead of calculating N!, I want to know how many digits are in it. (Remember that N! = N * (N - 1) * (N - 2) * - * 2 * 1) Input Each line of the input will…
麻痹,感冒了. ------------------------------------------------感冒了的分割线------------------------------------------------ HDU 1210 也就是 FOJ 1062 http://acm.hdu.edu.cn/showproblem.php?pid=1210 http://acm.fzu.edu.cn/problem.php?pid=1062 Eddy是个ACMer,他不仅喜欢做ACM题,而且对…
http://acm.fzu.edu.cn/problem.php?pid=1050 cmath头文件里有两种对数log()和log10(),一个是自然对数,一个是以10为底, 求n!的位数,根据对数公式log10(MN) = log10(M)+log10(N),又发现位数等于log10(MN)+1. 注意double强制转int和用floor函数有区别!!! floor返回原类型,而int返回int型.而且当如-3.2时,floor返回-4,int返回-3 #include<iostream>…
Mysql-5.6.30卸载 一.删除相关文件 rm  -rf  /var/lib/mysql/mysql   (删除数据文件) rm  -f  /root/.mysql_secure    (删除缺省root密码文件,以便rpm包安装时重新生成 二.卸载MySQL-server-5.6.30-1.el6.x86_64包 rpm -e MySQL-server-5.6.30-1.el6.x86_64 三.重新安装MySQL-server-5.6.30-1.el6.x86_64包 rpm -ivh…
C - Prime number or not Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice FZU 1649 Description Your task is simple.Give you a number N, you should judge whether N is a prime number or not. Input There…
  http://acm.fzu.edu.cn/problem.php?pid=2111  Problem 2111 Min Number Accept: 572    Submit: 1106Time Limit: 1000 mSec    Memory Limit : 32768 KB  Problem Description Now you are given one non-negative integer n in 10-base notation, it will only cont…
题目传送门 /* 数学:假设取了第i个,有C(n-1)(i-1)种取法 则ans = sum (C(n-1)(i-1)) (1<i<=n) 即2^(n-1) */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> using namespace std; typedef long long ll; ; const int INF = 0x3f3f3…
Mountain Number One integer number x is called "Mountain Number" if: (1) x>0 and x is an integer; (2) Assume x=a[0]a[1]...a[len-2]a[len-1](0≤a[i]≤9, a[0] is positive). Any a[2i+1] is larger or equal to a[2i] and a[2i+2](if exists). For exampl…
Problem 2111 Min Number Accept: 760    Submit: 1516 Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem Description Now you are given one non-negative integer n in 10-base notation, it will only contain digits ('0'-'9'). You are allowed to choos…
http://acm.fzu.edu.cn/problem.php?pid=2109 题意:找出区间[l,r]内满足奇数位的数字大于相邻偶数位数字的个数. 典型的数位dp了,记录一下当前位是奇数位还是偶数位. 状态设计为到当前位为(奇数还是偶数的条件下上一位数字为x的)满足条件的 个数. #include<cstdio>#include<cstring>#include<algorithm>;];;        ;    }    ;    ; ;    ;i<…