请教一下各位大神,为何会WA90

type bignum=array[1..201] of longint;
var f:array[1..200] of longint;
p:array[1..200] of boolean;
a,b,c,d,n,m,i,fa,fc,u:longint;
p1,p2:boolean;
ans,aa:bignum;
function father(x:longint):longint;
begin
if x=f[x] then exit(x);
father:=father(f[x]);
f[x]:=father;
if p[x] then p[x]:=p[f[x]] else p[x]:=not(p[f[x]]);
end;
procedure mul(var a,b:bignum);
var i,j:longint;
c:bignum;
begin
for i:=1 to 200 do c[i]:=0;
for i:=1 to 200 do for j:=1 to 200 do if i+j-1<=200 then inc(c[i+j-1],a[i]*b[j]);
for i:=1 to 200 do if c[i]>=10 then begin
inc(c[i+1],c[i] div 10);
c[i]:=c[i] mod 10;
end;
a:=c;
end;
procedure power(m:longint);
begin
if m=1 then begin
ans:=aa;
exit;
end;
if m and 1=0 then begin
power(m shr 1);
mul(ans,ans);
end else begin
power(m shr 1);
mul(ans,ans);
mul(ans,aa);
end;
end;
begin
readln(n,m);
for i:=1 to n do begin
f[i]:=i;
p[i]:=true;
end;
u:=n;
for i:=1 to m do begin
readln(a,b,c,d);
fa:=father(f[a]);
fc:=father(f[c]);
if fa=fc then begin
if (b=d)xor(p[a]=p[c]) then begin
writeln('No Answer');
halt;
end;
continue;
end;
dec(u);
f[fa]:=fc;
p1:=p[a];
p2:=p[c];
p1:=p1 xor p2;
if p1 then b:=1-b;
if b=d then p[fa]:=true else p[fa]:=false;
end;
aa[1]:=2;
power(u);
a:=0;
for i:=200 downto 1 do if (ans[i]<>0)or(a>0) then begin
a:=1;
write(ans[i]);
end;
if a=0 then write(0);
writeln;
end.
评测结果
编译成功

测试数据 #0: WrongAnswer, time = 0 ms, mem = 736 KiB, score = 0

测试数据 #1: Accepted, time = 0 ms, mem = 736 KiB, score = 10

测试数据 #2: Accepted, time = 0 ms, mem = 740 KiB, score = 10

测试数据 #3: Accepted, time = 0 ms, mem = 740 KiB, score = 10

测试数据 #4: Accepted, time = 0 ms, mem = 736 KiB, score = 10

测试数据 #5: Accepted, time = 0 ms, mem = 736 KiB, score = 10

测试数据 #6: Accepted, time = 0 ms, mem = 740 KiB, score = 10

测试数据 #7: Accepted, time = 0 ms, mem = 736 KiB, score = 10

测试数据 #8: Accepted, time = 15 ms, mem = 744 KiB, score = 10

测试数据 #9: Accepted, time = 0 ms, mem = 740 KiB, score = 10

WrongAnswer, time = 15 ms, mem = 744 KiB, score = 90

4 条评论

  • @ 2014-09-27 00:56:20

    居然还能ac到90,神奔啊!!!膜拜ing……

  • @ 2014-04-04 23:21:06

    这个帖子不要沉呀

  • @ 2014-04-01 22:26:12

    跪求大牛神牛们帮一下忙

  • @ 2014-03-31 22:33:14

    没人吗

  • 1

信息

ID
1221
难度
6
分类
数据结构 | 并查集 点击显示
标签
(无)
递交数
759
已通过
193
通过率
25%
被复制
3
上传者