E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
Factstone
Factstone
Benchmark
DescriptionAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingitsstrategyofdoublingtheword-sizeeverytenyears.(Amtelreleaseda64-bitcomputerin2000,a32-
晨识草
·
2020-07-07 13:56
sicily
POJ-2661
Factstone
Benchmark
FactstoneBenchmarkTimeLimit:1000MSMemoryLimit:65536KTotalSubmissions:5577Accepted:2524DescriptionAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingi
Caution_X
·
2019-10-10 22:00
Factstone
Benchmark | 使用log函数缩小数值范围
题目:•题意:1960年发行了4位计算机,从此以后每过10年,计算机的位数变成两倍。输入某一个年份,求出在这个年份的最大的整数n使得n!能被一个字表示。•限制:年份1960#include#include#includeusingnamespacestd;intgetMaxN(intyear){intbitLen=1>year&&year){cout<
linzch3
·
2017-06-29 16:03
Oj
ACM--数学--HDOJ 1141--
Factstone
Benchmark--水
HDOJ题目地址:传送门FactstoneBenchmarkTimeLimit:10000/5000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):2010 AcceptedSubmission(s):1114ProblemDescriptionAmtelhasannouncedthatit
qq_26891045
·
2016-05-21 13:00
数学
ACM
Benchmark
hdoj
水
1141
Factstone
Factstone
Benchmark
Amtel于2000年发行了64位计算机,在1990年发行了32位计算机,在1980年发行了16位计算机,在1970年发行了8位计算机,并首先在1960年发行了4位计算机)Amtel将使用新的标准检查等级——
Factstone
hoojjack
·
2016-03-03 18:00
POJ 2661
Factstone
Benchmark (log2的故事)
新的linux系统下写的第一个C++程序。(哎compileerror了两次,log2(x)化成logx/log2,logx是以自然对数为底的)http://poj.org/problem?id=2661转化题意:求解最大的n,满足转化:开始不敢用浮点数,直接走向了素因子的错误道路。。。其实有时浮点运算还是可以信赖的。#include #include #include usingnamespac
theArcticOcean
·
2016-01-22 14:00
log2
poj-2661-
Factstone
Benchmark
解题思路:在1960年,字的大小是4位,以后每十年翻一番,就意味着,y年的字的位数为k=pow(2,(y-1960)/10),而k位的无符号整数是pow(2,k)-1,n!要小于等于pow(2,k)-1。直接进行求解容易溢出和超时,所以采用对数运算。n!#include #include usingnamespacestd; intmain() { intk,Y,i; doublesum,y; w
acm_JL
·
2015-11-21 00:00
Factstone
Benchmark
1119.FactstoneBenchmarkConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingitsstrategyofdoubling
huangjq36SYSU
·
2015-11-17 16:00
poj2661
Factstone
Benchmark
链接 利用log函数来求解 n!<=2^k k会达到400+W 暴力就不要想了,不过可以利用log函数来做 log2(n!) = log2(1)+log2(2)+..log2(n)<=k 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 #incl
·
2015-11-12 09:43
mark
sicily 1119
Factstone
Benchmark
题意:求满足n! < 2^k,n的最大值! 解题:指数比较转换成对数比较,达到降幂! 其中: log (n!) = log(n)+log(n-1)+...+log(1); log(2^k) = k * log(2); 当然也可以使用斯特林(stirling 公式求
·
2015-11-10 22:51
mark
poj 2661
Factstone
Benchmark (Stirling数)
//题意是对于给定的x,求满足n! <= 2^(2^x)的最大的n//两边同取以二为底的对数,可得: lg2(n!) <= 2^x 1. log2(n!) = log2(1) + log2(2) + .. + log2(n);一个循环即可 2. Stirling #i
·
2015-11-02 11:02
mark
uva 10916
Factstone
Benchmark(对数函数的活用)
Factstone
Benchmark Amtel has announced that it will release a 128-bit computer chip by 2010, a 256-
·
2015-10-31 11:28
mark
UVA - 10916
Factstone
Benchmark(数学)
ProblemB:FactstoneBenchmarkAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingitsstrategyofdoublingtheword-sizeeverytenyears.(Amtelreleaseda64-bitcom
HelloWorld10086
·
2014-08-28 20:00
Benchmark
uva
Factstone
10916
UVA 10916
Factstone
Benchmark
#include #include intmain(){ intyear; while(scanf("%d",&year),year){ intn=(year-1940)/10; doublek=pow(2.0,n)*log(2.0); doublesum=0; inti; for(i=1;sum<=k;i++){ sum+=log(i*1.0); } printf("%d\n",i-2); }
kl28978113
·
2014-07-27 10:00
Factstone
Benchmark
挺水的一道题,看懂题意:核心的话就是,计算n!<2^K,(n+1)>=2^k的n;如果直接按照这个算的话,不用大数,应该会超范围,而考虑到对数的话,就可以避开大数;log(n!)=log(n)+log(n-1)+....+log(1);这样就可以啦:代码:#include #include usingnamespacestd; intmain() { intyear,k; while(cin>>y
u013652219
·
2014-07-23 23:00
对数
TOJ
hdu 1141
Factstone
Benchmark
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1141题目描述:FactstoneBenchmarkTimeLimit:10000/5000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):1624 AcceptedSubmission(s):9
hackerwin7
·
2014-07-21 20:00
浮点数
10916 -
Factstone
Benchmark
题目:10916-FactstoneBenchmark题目大意:求N! #include intyear; intmain(){ while(scanf("%d",&year)&&year){ year=(year-1940)/10; doubles1,s2=0; s1=pow(2,year); for(inti=1;;i++){ s2+=log(i)/log(2); if(s2>s1)
u012997373
·
2014-01-19 16:00
2013秋13级预备队集训练习4 --H -
Factstone
Benchmark
ProblemB:FactstoneBenchmarkAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingitsstrategyofdoublingtheword-sizeeverytenyears.(Amtelreleaseda64-bitcom
u013015642
·
2014-01-02 22:00
Factstone
Benchmark
这个题。。百度得知用取对数法。。ProblemB:FactstoneBenchmarkAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingitsstrategyofdoublingtheword-sizeeverytenyears.(Amtelre
u013013910
·
2013-12-29 20:00
编程
C语言
UVa 10916
Factstone
Benchmark (数学&阶乘的处理技巧)
10916-FactstoneBenchmarkTimelimit:3.000secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=99&page=show_problem&problem=1857Amtelhasannouncedthatitwillreleasea128-bitc
synapse7
·
2013-09-15 14:00
C++
ACM
uva
UVA10916-
Factstone
Benchmark
计算n的最大值,2^n>n!,如果一直整数相乘的话,会越界,所以要取对数。#include #include #include usingnamespacestd; intmain(){ intn,i; doublem,sum; while(scanf("%d",&n)&&n){ m=pow(2,(n-1940)/10)*log(2); sum=0; for(inti=1;;i++){ sum+
u011345461
·
2013-08-16 19:00
uva 10916
Factstone
Benchmark(对数函数的活用)
FactstoneBenchmarkAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingitsstrategyofdoublingtheword-sizeeverytenyears.(Amtelreleaseda64-bitcomputerin20
u011328934
·
2013-07-31 13:00
10916 -
Factstone
Benchmark
ProblemB:FactstoneBenchmarkAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingitsstrategyofdoublingtheword-sizeeverytenyears.(Amtelreleaseda64-bitcom
SIOFive
·
2013-07-23 22:00
uva
B.10916 -
Factstone
Benchmark
这道题花了很多时间,开始以为是求最高位所表示的最大值.一直WA.又看了后,理解到是求所有位元能够保存的最大m!.后来看了大神的解释: 求m!log2(m!)log2(1)+log2(2)+...+log2(m)有log2()计算公式,直接套用计算就行了.intmain(){ doublebite[21]={4.0}; for(inti=1;i2160年间位元的长度全部求出. inty; w
PandaCub
·
2013-06-25 00:00
uva
Maths-Misc
【ACM】杭电1141:
Factstone
Benchmark
我觉得这道题值得一写,是因为它用到了取对数的方法来处理数值过大的阶乘问题。这种方法应该熟练掌握。分析:问题实际上可以转化成一个不等式:n! #include intPow(intbottom,intbit)/*用来求bottom的bit次方*/ { inti,res=1; for(i=1;i<=bit;++i) res*=bottom; returnres; } intmain(intargc,
tracker_w
·
2012-11-05 21:00
POJ 2661
Factstone
Benchmark
DescriptionAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingitsstrategyofdoublingtheword-sizeeverytenyears.(Amtelreleaseda64-bitcomputerin2000,a32-
ultimater
·
2012-08-11 09:00
Integer
input
each
output
2010
Factstone
Benchmark
题目来源:http://soj.me/11191119.FactstoneBenchmarkConstraintsTimeLimit:1secs,MemoryLimit:32MBDescriptionAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continui
BetaBin
·
2012-07-26 11:00
算法
Date
Integer
input
each
output
uva-10916 -
Factstone
Benchmark
好吧。。。暴力是那么的简单。。。。#include #include intmain() { ints[30]={3,5,8,12,20,34,57,98,170,300,536,966,1754,3210,5910,10944,20366,38064,71421,134480,254016}; intn; while(scanf("%d",&n)&&n) { printf("%d\n",s[(n
rowanhaoa
·
2012-07-18 10:00
uva 10916 -
Factstone
Benchmark
ProblemB:FactstoneBenchmarkAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingitsstrategyofdoublingtheword-sizeeverytenyears.(Amtelreleaseda64-bitcom
Frankiller
·
2012-06-16 10:00
uva 10916
Factstone
Benchmark
题意:给你一个年份y,1960 #include #include #include usingnamespacestd; constintN=30; inta[N]; intmain() { intcnt=1,num=0,k=4; doublesum=0; for(inti=0;i<25;i++,k*=2) { while(sum
shiqi_614
·
2011-12-03 00:00
POJ 2661
Factstone
Benchmark 斯特林(stirling公式)应用
http://poj.org/problem?id=2661FactstoneBenchmarkTimeLimit:1000MSMemoryLimit:65536KDescriptionAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingitsst
thecloud
·
2011-01-28 11:00
mark
POJ 2661
Factstone
Benchmark 斯特林(stirling公式)应用
http://poj.org/problem?id=2661 FactstoneBenchmarkTimeLimit: 1000MS MemoryLimit: 65536KDescriptionAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingi
yming0221
·
2011-01-28 11:00
cache
ubuntu
Integer
input
compiler
output
POJ 2661
Factstone
Benchmark 斯特林(stirling公式)应用
http://poj.org/problem?id=2661FactstoneBenchmarkTimeLimit:1000MSMemoryLimit:65536KDescriptionAmtelhasannouncedthatitwillreleasea128-bitcomputerchipby2010,a256-bitcomputerby2020,andsoon,continuingitsst
soboer
·
2011-01-28 11:00
mark
Factstone
Benchmark
TAG数论 求max{n|n!#includeintp2[24];intans[21];intn;voidmakepow2(){for(inti=0;ip2[i]){ret=i;}else{break;}}returnret-1;}voidpre(){makepow2();doublesum;for(inti=2;true;++i){sum+=log(i)/log(2);inttmp=inpow2
Dinosoft
·
2010-07-16 14:00
Factstone
Benchmark
TAG 数论 求 max{ n | n! < 2^(2^k) }, 其中k=(year-1960)/10+2; 阶乘结果会很大,所以两边取对数。log2(n!)=log2(n)*log2(n-1)*......*log2(1) 我是直接把所有结果求出来。 ps: 求阶乘的对数可以用 斯特林公式: log10(n!) = log10(sqrt(2 * pi * n)) +
yzd
·
2010-07-16 14:00
mark
fjnu 1925
Factstone
Benchmark
fjnu1925FactstoneBenchmarkhttp://acm.fjnu.edu.cn/show?problem_id=1925问题描述:Amtel公司宣佈他們會在2010年發行128位元的電腦,在2020年發行256位元的電腦,在這個策略之下往後每10年就發行2倍位元的電腦。(Amtel公司在2000年發行64位元,1990年發行32位元電腦,1980年發行16位元電腦,1970年發行
dreamangel
·
2009-12-03 20:00
上一页
1
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他