讨论 / 管理员来看啊!救命!
shimingxin 2008-08-09 06:21:00
点我顶贴 收藏 删除
Program ex1;

var

a:array[0..100,1..3] of longint;

b:array[0..100,1..3] of longint;

i,j,n,m,k,tail,head:longint;

f:array[0..5000,1..3] of longint;

p:boolean;

begin

readln(n,m);

for i:=1 to n do

read(a[i,1],a[i,2]);

for i:=1 to m do

read(b[i,1],b[i,2]);

i:=0;

repeat

i:=i+1;

head:=-1;

tail:=0;

repeat

head:=head+1;

for k:=1 to n do

a[k,3]:=0;

a[f[tail,3],3]:=1;

for j:=1 to n do

if a[j,3]=0 then

begin

p:=true;

for k:=1 to tail do

if (f[tail,1]=a[j,1]+f[head,1]) and (f[tail,2]=a[j,2]+f[head,2]) then

p:=false;

if p then

begin

a[j,3]:=1;

tail:=tail+1;

f[tail,3]:=j;

f[tail,1]:=a[j,1]+f[head,1];

f[tail,2]:=a[j,2]+f[head,2];

if f[tail,1]*b[i,2]=f[tail,2]*b[i,1] then

begin

if i=m then

write(1)

else

writeln(1);

i:=i+1;

if i=m+1 then

halt;

end;

end;

end;

until head>=tail;

writeln(0);

until i=m;

end.

为什么说我没输出?

测试数据都对!

管理员能不能重测一下!

编号78490!

查看更多回复
提交回复