测评机: 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.
查一下错在那...