讨论 / 为啥50分?
lishuhanji 2013-10-28 03:11:00
点我顶贴 收藏 删除
题目:Round Numbers

状态: Unaccepted

测评机: Xeond[6]

得分: 50分

提交日期: 2013-8-26 15:17:00

有效耗时: 该状态没有记录

测试结果1: 通过本测试点|有效耗时172ms

测试结果2: 通过本测试点|有效耗时172ms

测试结果3: 通过本测试点|有效耗时157ms

测试结果4: 通过本测试点|有效耗时171ms

测试结果5: 通过本测试点|有效耗时297ms

测试结果6: 选手程序运行超过时限

测试结果7: 测试结果错误.错误结果为:1760693

正确结果应为:615800726

测试结果8: 测试结果错误.错误结果为:1760693

正确结果应为:937563778

测试结果9: 选手程序运行超过时限

测试结果10: 测试结果错误.错误结果为:1760693

正确结果应为:937891981

提交代码:

01.var

02.l,n0,n1,n,a,b,i:longint;

03.begin

04.read(a,b);l:=0;

05.for i:=a to b do begin

06.n:=i;

07.n1:=0;n0:=0;

08.repeat

09.if n mod 2=1 then n1:=n1+1

10.else n0:=n0+1;

11.n:=n div 2 ;

12.until n=0;

13.if n0>=n1 then l:=l+1;

14.end;

15.write(l);

16.end.

#1 BarackObama@2013-08-26 04:42:00
回复 删除
请用高精度
#2 0*1@2013-10-28 03:11:00
回复 删除
int64可以吗

var

t,y,s,s0,s1,s3:int64;

begin

readln(t,y);

s:=0;

while t<=y do

begin

s1:=0;

s0:=0;

s3:=t;

while s3>0 do

begin

if s3 mod 2=0 then inc(s0)

else inc(s1);

s3:=s3 div 2;

end;

if s0>=s1 then inc(s);

inc(t);

end;

writeln(s);

end.

查看更多回复
提交回复