讨论 / 为什么全都没输出
464271301 2012-07-26 20:18:00
点我顶贴 收藏 删除
状态: Unaccepted

测评机: Xeost[5]

得分: 0分

提交日期: 2012-7-27 11:11:00

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

测试结果1: 选手程序无输出

测试结果2: 选手程序无输出

测试结果3: 选手程序无输出

测试结果4: 选手程序无输出

测试结果5: 选手程序无输出

测试结果6: 选手程序无输出

测试结果7: 选手程序无输出

测试结果8: 选手程序无输出

测试结果9: 选手程序无输出

测试结果10: 选手程序无输出

var n,i,min,max,now1,now2,ans,j:longint;

a:array[1..1000] of longint;

two:array[1..30] of longint;

procedure find(x,y:longint);

var i:longint;

begin

now1:=a[x];now2:=a[y];

ans:=0;

i:=1;

while (now1>0) and (now2>0) do

begin

if (now1 mod 7)<>(now2 mod 7) then

inc(ans,two[i]);

inc(i);

now1:=now1 div 7;

now2:=now2 div 7;

end;

if (now1>0) then now2:=now1;

while now2>0 do

begin

if now2 mod 7<>0 then

inc(ans,two[i]);

inc(i);

now2:=now2 div 7;

end;

if abs(ans-123)<min then

begin

min:=abs(ans-123);

max:=ans;

end;

end;

begin

readln(n);

two[1]:=1;

for i:=2 to n do

begin

two[i]:=two[i-1]<<1;

end;

for i:=1 to n do read(a[i]);

min:=maxlongint;

for i:=1 to n-1 do

for j:=i+1 to n do

find(i,j);

write(max);

end.

查看更多回复
提交回复