- 家族
- 2009-01-12 17:14:38 @
program Dzs;
var
a,b,c,d,n,m,p,i,j,k:longint;
q:array[0..10000]of longint;
function aa(a:longint):longint;
begin
while q[a]>0 do
a:=q[a];
aa:=a;
end;
begin
readln(n,m,p);
for i:=1 to m do
begin
readln(a,b);
j:=aa(a);
k:=aa(b);
if jk then q[j]:=k;
end;
for i:=1 to p do
begin
readln(a,b);
j:=aa(a);
if aj then q[a]:=j;
k:=aa(b);
if bk then q:=k;
if j=k then writeln('Yes')(这里很阴)
else writeln('No');
end;
end.
2 条评论
-
半度微凉 LV 10 @ 2014-10-22 20:55:08
你好大头
-
2014-08-03 20:54:27@
卧槽 输出全大写的害我wa3次!!!!!!!!!
- 1