Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
555555555555 Why I got WA给个特殊点的数据把var use:array[1..8] of integer; s:array[1..8] of string[8]; n,k,ans:integer; procedure init; var i,j:integer; ch:char; begin fillchar(use,sizeof(use),0); fillchar(s,sizeof(s),' '); for i:=1 to n do readln(s[i]); ans:=0; end; procedure work(step,y:integer); var i:integer; begin if step=k+1 then inc(ans) else if y=n+1 then exit else for i:=0 to n do if i=0 then work(step,y+1) else if (use[i]=0) and (s[y,i]='#') then begin use[i]:=1; work(step+1,y+1); use[i]:=0; end; end; begin readln(n,k); while (n<>-1) do begin init; work(1,1); writeln(ans); readln(n,k); end; end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator