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 |
大家帮我看看,Why WA?(PASCAL)var a:array[1..100005]of longint; n,i,bj:integer; begin readln(n); while n<>0 do begin bj:=1; for i:=1 to n do read(a[i]);readln; for i:=1 to n do if a[a[i]]<>i then begin bj:=0;break;end; if bj=0 then writeln('not ambiguous') else writeln('ambiguous'); readln(n); end; end. Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator