讨论 / 求助!!!!!
a12091209 2011-11-27 20:26:00
点我顶贴 收藏 删除
状态: Unaccepted

测评机: Xeond[6]

得分: 75分

提交日期: 2011-11-24 13:11:00

有效耗时: 546毫秒

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

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

测试结果3: 测试结果错误.错误结果为:147483648

正确结果应为:2147483648

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

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

测试结果6: 测试结果错误.错误结果为:97152

正确结果应为:2097152

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

正确结果应为:262144

测试结果8: 通过本测试点|有效耗时47ms

测试结果9: 通过本测试点|有效耗时47ms

测试结果10: 通过本测试点|有效耗时47ms

测试结果11: 通过本测试点|有效耗时47ms

测试结果12: 通过本测试点|有效耗时46ms

提交代码: view sourceprint?01.program fasd;

02.

var a:longint;

03.

function mi(a:longint):longint;

04.

var s,i,ans:longint;

05.

begin

06.

s:=1;

07.

ans:=maxlongint;

08.

for i:=1 to 64 do begin

09.

s:=s*2;

10.

if (a-s>=0) and (a-s<=ans) then ans:=a-s else

11.

if (s-a>=0) and (s-a<=ans) then ans:=s-a;

12.

mi:=ans;

13.

end;

14.

end;

15.

begin

16.

read(a);

17.

writeln(mi(a));

18.

end.

查一下错在那...

#1 a12091209@2011-11-27 20:26:00
回复 删除
.............

#2 a12091209@2011-11-27 20:26:00
回复 删除
11111111111

查看更多回复
提交回复